Bug #63657 [Asn]: pgsqlCopyFromFile, pgsqlCopyToArray use Postgres < 7.3 syntax
| From: | mbeccati@php.net | Date: | Fri, 07 Jun 2013 07:19:18 +0000 |
| Subject: | Bug #63657 [Asn]: pgsqlCopyFromFile, pgsqlCopyToArray use Postgres < 7.3 syntax | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-179383@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63657&edit=1
ID: 63657
Updated by: mbeccati@php.net
Reported by: ch@php.net
-Summary: pgsqlCopyFromFile, pgsqlCopyToArray have syntax
errors
+Summary: pgsqlCopyFromFile, pgsqlCopyToArray use Postgres <
7.3 syntax
Status: Assigned
Type: Bug
Package: PDO related
PHP Version: 5.4.9
Assigned To: mbeccati
Block user comment: N
Private report: N
New Comment:
That's simply not true. If you were receiving an error, it must have been something else. See:
http://www.postgresql.org/docs/9.2/static/sql-copy.html#AEN66829
At some point compatibility with <7.3 syntax might be dropped though, so I'm going to follow
the suggestion anyway (using pre-9.0 syntax).
Previous Comments:
------------------------------------------------------------------------
[2012-11-30 12:28:34] ch@php.net
Description:
------------
In ext/pdo_pgsql/pgsql_driver.c the methods pgsqlCopyToArray, pgsqlCopyFromArray etc. all use the
following syntax:
COPY %s FROM STDIN DELIMITERS E'%c' WITH NULL AS E'%s'
In at least PostgreSQL 9.2 this is a syntax error though. The correct syntax is:
COPY %s FROM STDIN WITH DELIMITER E'%c', NULL AS E'%s'
a) the "WITH" is optional but must come immediately after the STDIN if given
b) it's a singular "DELIMITER", not plural
(btw, these method are undocumented anyway, see my other bug report about that)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63657&edit=1