php.net |  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 (profile)
Status: Closed Package: PostgreSQL related
PHP Version: 5.3.2 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cbandy at jbandy dot com
New email:
PHP Version: OS:

 

 [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
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=298223
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] 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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC