Caused by: org.postgresql.util.PSQLException: ERROR: column "docdta" is of type bytea but _expression_ is of type oid
Hint: You will need to rewrite or cast the _expression_."
One of the benefits of doing that is that you can "stream" LOB's (you access it like a file; opening, reading, seeking), whereas AFAIK you have to retrieve BYTEA data as a whole before you can start sending it to the client.