Question

I have a fairly short (14-byte) bytea data column in my database. I would like to print it as a hexadecimal string.

How do I do that?

Was it helpful?

Solution

Based on this answer, I found my solution to be

SELECT encode(my_column::bytea, 'hex') FROM my_table;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top