Thanks Dan!
You are right. That seems to work for insert, supported by query()
But for retrieval queries (using query() or select()) I think the
limitation is in $results->hash only expands json or jsonb in the
_expand subroutine in Mojo::Pg::Results
Looking at the code in _expand (some of it is a bit mind bending)
maybe there is a way to do it by querying a single field in the select
statement (single field select with type=PG_BYTEA) but I tried several
ways and none worked.
I believe adding a new case to the json/jsonb case in _results for the
bytea type and support "raw" bytes could solve the issue but I am time
constrained and it's cheaper for me to change the database model for
now than trying to hack away at this.
It would be nice though if this is supported in the future or if
someone volunteers to submit a patch in this regard.
Best,
Alejandro Imass