pg_copy_from does not allow schema in the tablename argument

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 (profile)
Status: Closed Package: PostgreSQL related
PHP Version: 5.3.2 OS: Linux
Private report: No CVE-ID: None

 [2010-04-20 01:50 UTC] cbandy at jbandy dot com

Description:
------------
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

Patches

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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports

 [2010-04-20 17:59 UTC] felipe@php.net

-Status: Open +Status: Closed -Assigned To: +Assigned To: felipe

 [2010-04-20 17:59 UTC] felipe@php.net

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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Thanks for the patch.