|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51607 pg_copy_from does not allow schema in the tablename argument
Submitted: 2010-04-20 01:50 UTC Modified: 2010-04-20 17:59 UTC
From: cbandy at jbandy dot com Assigned: felipe
Status: Closed Package: PostgreSQL related
PHP Version: 5.3.2 OS: Linux
Private report: No CVE-ID:
 [2010-04-20 01:50 UTC] cbandy at jbandy dot com
It is not possible to include the schema when passing a table name to pg_copy_from, e.g. pg_copy_from($conn, "schema.tablename", $rows).

r291312 addressed this issue for pg_copy_to, though the attached patch seems simpler.

Test script:
// setup
pg_query($db, 'CREATE SCHEMA temp_test_schema');
pg_query($db, 'CREATE TABLE temp_test_schema.temp_test_table (a INT)');

// test
pg_copy_from($db, 'temp_test_schema.temp_test_table', array('1'));

// cleanup
pg_query($db, 'DROP SCHEMA temp_test_schema CASCADE');

Expected result:
The row is copied without error

Actual result:
pg_copy_from() : Copy command failed: ERROR: relation "temp_test_schema.temp_test_table" does not exist


pgsql_copy_schema.patch (last revision 2010-04-19 23:51 UTC) by cbandy at jbandy dot com)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-20 17:59 UTC]
Automatic comment from SVN on behalf of felipe
Log: - Fixed bug #51607 (pg_copy_from does not allow schema in the tablename argument)
  Patch by: cbandy at jbandy dot com
 [2010-04-20 17:59 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: felipe
 [2010-04-20 17:59 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

Thanks for the patch.
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Fri Nov 27 06:02:02 2015 UTC