Hi Oleg,

Am 26.07.2017 um 23:49 schrieb Oleg Broytman:
>     Shouldn't unescape_bytea(escape_bytea()) be idempotent?

See https://www.postgresql.org/docs/9.6/static/libpq-exec.html

"PQunescapeBytea is not exactly the inverse of PQescapeBytea, because the string is not expected to be "escaped" when received from PQgetvalue. In particular this means there is no need for string quoting considerations, and so no need for a PGconn parameter."

Note that if possible you should use the escape_bytea() method of the connection, not the module level function, because it takes the setting of the database parmaeter bytea_output for the connection into account. The unescape_bytea() method of the connection is the same as the module level function, however.

-- Chris
_______________________________________________
PyGreSQL mailing list
PyGreSQL@vex.net
https://mail.vex.net/mailman/listinfo.cgi/pygresql

Reply via email to