From 0f3bace4f8f25052929728cc9cede70209827108 Mon Sep 17 00:00:00 2001 From: Yasuo Ohgaki Date: Tue, 9 Apr 2002 00:30:49 +0000 Subject: [PATCH] Added limitations of bytea type and pg_escape_bytea. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@77241 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/pgsql.xml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/functions/pgsql.xml b/functions/pgsql.xml index 7e059435b4..9591981704 100644 --- a/functions/pgsql.xml +++ b/functions/pgsql.xml @@ -1,5 +1,5 @@ - + PostgreSQL functions PostgreSQL @@ -2292,8 +2292,23 @@ $dbconn4 = pg_connect ($conn_string); - This function is requires PostgreSQL 7.2 or later. - + When you SELECT bytea type, PostgreSQL returns octal byte value + prefixed by \. (e.g. \032) Users are supposed to convert back to + binary formant by yourself. + + + This function requires PostgreSQL 7.2 or later. With PostgreSQL + 7.2.0 and 7.2.1, bytea type must be casted when you enable + multi-byte support. i.e. INSERT INTO test_table (image) + VALUES ('$image_escaped'::bytea); PostgreSQL 7.2.2 or + later does not need cast. Exception is when client and backend + character encoding does not match, there may be multi-byte + stream error. User must cast to bytea to avoid this error. + + + Newer PostgreSQL will support unescape function. Support for + built-in unescape function will be added when it's available. + See also pg_escape_string