php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #51607
Patch pgsql_copy_schema.patch revision 2010-04-19 23:51 UTC by cbandy at jbandy dot com

Patch pgsql_copy_schema.patch for PostgreSQL related Bug #51607

Patch version 2010-04-19 23:51 UTC

Return to Bug #51607 | Download this patch
Patch Revisions:

Developer: cbandy@jbandy.com

--- php-5.3.2/ext/pgsql/pgsql.c.orig	2010-01-03 03:23:27.000000000 -0600
+++ php-5.3.2/ext/pgsql/pgsql.c	2010-04-19 18:23:05.000000000 -0500
@@ -3764,11 +3764,7 @@
 		pg_null_as = safe_estrdup("\\\\N");
 	}
 
-	if (memchr(table_name, '.', table_name_len)) {
-		spprintf(&query, 0, "COPY %s TO STDOUT DELIMITERS '%c' WITH NULL AS '%s'", table_name, *pg_delim, pg_null_as);
-	} else {
-		spprintf(&query, 0, "COPY \"%s\" TO STDOUT DELIMITERS '%c' WITH NULL AS '%s'", table_name, *pg_delim, pg_null_as);
-	}
+	spprintf(&query, 0, "COPY %s TO STDOUT DELIMITERS '%c' WITH NULL AS '%s'", table_name, *pg_delim, pg_null_as);
 
 	while ((pgsql_result = PQgetResult(pgsql))) {
 		PQclear(pgsql_result);
@@ -3898,7 +3894,7 @@
 
 	ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink);
 
-	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 DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, *pg_delim, pg_null_as);
 	while ((pgsql_result = PQgetResult(pgsql))) {
 		PQclear(pgsql_result);
 	}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 10:01:28 2024 UTC