|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-07-12 13:38 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 19:00:01 2025 UTC |
Description: ------------ 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. Reproduce code: --------------- <?php $conn = pg_connect(...); pg_set_client_encoding($conn, 'UTF8'); $res = pg_query_params('SELECT $1::bytea', array("\xf6")); var_dump(pg_fetch_array($res)); Expected result: ---------------- Some binary string :) Actual result: -------------- 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 ...