]> granicus.if.org Git - php/commitdiff
Fix bug #73498
authorCraig Duncan <git@duncanc.co.uk>
Sun, 20 Nov 2016 20:48:21 +0000 (20:48 +0000)
committerAnatol Belski <ab@php.net>
Mon, 21 Nov 2016 23:42:45 +0000 (00:42 +0100)
Postgres uses the DELIMITER keyword since 7.3
And WITH is no longer required/used

ext/pgsql/pgsql.c

index dfe8a7ddb2be5528b60a9362021b531a2e4feb42..b746595250fb0aa33c600ebab5de086dcfa9e3f7 100644 (file)
@@ -4054,7 +4054,7 @@ PHP_FUNCTION(pg_copy_to)
                free_pg_null = 1;
        }
 
-       spprintf(&query, 0, "COPY %s TO STDOUT DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, *pg_delim, pg_null_as);
+       spprintf(&query, 0, "COPY %s TO STDOUT DELIMITER E'%c' NULL AS E'%s'", table_name, *pg_delim, pg_null_as);
 
        while ((pgsql_result = PQgetResult(pgsql))) {
                PQclear(pgsql_result);
@@ -4187,7 +4187,7 @@ PHP_FUNCTION(pg_copy_from)
                pg_null_as_free = 1;
        }
 
-       spprintf(&query, 0, "COPY %s FROM STDIN DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, *pg_delim, pg_null_as);
+       spprintf(&query, 0, "COPY %s FROM STDIN DELIMITER E'%c' NULL AS E'%s'", table_name, *pg_delim, pg_null_as);
        while ((pgsql_result = PQgetResult(pgsql))) {
                PQclear(pgsql_result);
        }