můžete použít encode funkce:
select encode(bytea_column, 'hex')
from image;
Pokud chcete vidět pouze první bajty, stačí použít left() funkce na tom:
select left(encode(bytea_column, 'hex'), 40)
from image;
Více podrobností v manuálu:
https://www .postgresql.org/docs/current/static/functions-binarystring.html