Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error function decode(bytea unknown) does not exist

Tags:

postgresql

when I run this query in Postgres, on a bytea column:

SELECT decode(column_name, 'escape') FROM table_name;

I get this failure: error function decode(bytea unknown) does not exist

like image 430
rogerdpack Avatar asked Feb 28 '26 03:02

rogerdpack


1 Answers

Seems I got it flipped, you can use the decode method on inserts, ex:

 insert into table_name values (decode(E'abc123\\000456', 'escape'));

but not use it on selects, should be this instead

SELECT encode(column_name, 'escape') FROM table_name;
like image 131
rogerdpack Avatar answered Mar 06 '26 15:03

rogerdpack



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!