Zoltán
Zoltán

Reputation: 22146

How can I print bytea data as a hexadecimal string in PostgreSQL / pgAdmin III?

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?

Upvotes: 54

Views: 54081

Answers (1)

Zoltán
Zoltán

Reputation: 22146

Based on this answer, I found my solution to be

SELECT encode(my_column::bytea, 'hex') FROM my_table;

Upvotes: 103

Related Questions