accessing Blob/Clob fields in Postgres

7 views
Skip to first unread message

nathanie...@gmail.com

unread,
Apr 26, 2019, 4:16:34 PM4/26/19
to Slick / ScalaQuery
I eventually managed to answer my previous question (https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!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.

thanks,
Nat
Reply all
Reply to author
Forward
0 new messages