go to bug id or search bugs for
It's not possible to pass bytea values to pg_query_params or pg_execute. It seems like ext/pgsql does no escaping where it should. ext/pgsql is built against libpq 8.3.1.
$conn = pg_connect(...);
$res = pg_query_params('SELECT $1::bytea', array("\xf6"));
Some binary string :)
Warning: pg_query_params(): Query failed: ERROR: invalid byte sequence for encoding "UTF8": 0xf6
HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding". in ...
Add a Patch
Add a Pull Request
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
pgsql expects a utf-8 string there, got something else and fails -> no PHP issue