http://qs321.pair.com?node_id=522222


in reply to postgresql bytea escaping

How about just using the C API (via DBD::Pg) provided by pg? So:

 $quoted_data = $dbh->quote($data, PG_BYTEA)

Replies are listed 'Best First'.
Re^2: postgresql bytea escaping
by ketema (Scribe) on Jan 11, 2006 at 02:14 UTC
    That is a good idea. My original plan was to make this simple function an internal pl/perlu function so i could just code Insert statements like Insert into table (byteacol) values (encode_bytea('/path/to/bin/file')::bytea); But since it is a perlu function anyway I will test using the DBD Module in the function instead.