Brilliant Sam! I'm migrating a Firebird legacy app into Postgres, and your SQL works well. Question - the number of bytes is not specified in the write - could this be an issue? lowrite appears undocumented (as opposed to lo_write). -- View this message in context: http://postgresql.1045698.n5.nabble.com/How-to-convert-ByteA-to-Large-Objects-tp1914180p3425725.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general