summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2010-04-20 15:59:01 (GMT)
committerFelipe Pena <felipe@php.net>2010-04-20 15:59:01 (GMT)
commitb7bd1167a958ac356b31db5acb469a81086a7b78 (patch)
tree8a6a4be3b2332da295a20a9d9c1e47fd7b8245fe
parente7d3ec6dee56adcadee72b9991f828f34fe4938c (diff)
downloadphp-b7bd1167a958ac356b31db5acb469a81086a7b78.tar.gz
- Fixed bug #51607 (pg_copy_from does not allow schema in the tablename argument)
Patch by: cbandy at jbandy dot com
-rw-r--r--ext/pgsql/pgsql.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 5fbfd58..70e9d0b 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -3765,11 +3765,7 @@ PHP_FUNCTION(pg_copy_to)
free_pg_null = 1;
}
- if (memchr(table_name, '.', table_name_len)) {
- spprintf(&query, 0, "COPY %s TO STDOUT DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, *pg_delim, pg_null_as);
- } else {
- 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 DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, *pg_delim, pg_null_as);
while ((pgsql_result = PQgetResult(pgsql))) {
PQclear(pgsql_result);
@@ -3901,7 +3897,7 @@ PHP_FUNCTION(pg_copy_from)
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);
}