accessing Blob/Clob fields in Postgres

Skip to first unread message

Apr 26, 2019, 4:16:34 PM4/26/19
to Slick / ScalaQuery
I eventually managed to answer my previous question (!topic/scalaquery/2c3r-0zj7tk) - I now have Postgres configured with the 'lo' extension and everything appears to be working on the database side.  The problem I have now is that when I try to access the fields later in the Scala code, e.g. converting a Clob or Blob to a string, I get an error message about large objects requiring transactions, even though the table row was originally retrieved as part of a transaction.  It looks to me like the Postgres JDBC driver (or maybe Slick itself) is effectively lazy-loading the large objects.  Is there a way to disable this behavior?  Alternately, is there a way I could map Clob and Blob to the Postgres BYTEA type instead?  I don't mind customizing PostgresProfile if that's what it takes, but it's unclear to me how to do this.

Reply all
Reply to author
0 new messages