|
From: SourceForge.net <no...@so...> - 2007-03-03 15:44:04
|
Bugs item #1660510, was opened at 2007-02-15 06:43 Message generated for change (Comment added) made by xzilla You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=418980&aid=1660510&group_id=37132 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Import/Export Group: 4.1 Status: Open Resolution: None Priority: 5 Private: No Submitted By: maio (maiosoft) >Assigned to: Robert Treat (xzilla) Summary: Error exporting single mixed-case named table Initial Comment: Postgres 8.2.3 phpPgAdmin 4.1 Apache 2.2.4 php5 5.2.1 phpPgAdmin doesn't export single table with mixed-case name; it works exporting the whole db; it works exporting lower-case name; from command line pg_dump works fine: pg_dump -U user -t '"MixedCaseName"' mydb > mytab.sql Postgres doesn't log anything; Apache logs "pg_dump: No matching tables were found"; the problem appears in COPY and SQL export format; regards ---------------------------------------------------------------------- >Comment By: Robert Treat (xzilla) Date: 2007-03-03 10:44 Message: Logged In: YES user_id=204589 Originator: NO The following patch seems to fix it for me, can you try it out and see if it works for you? TIA Index: dbexport.php =================================================================== RCS file: /cvsroot/phppgadmin/webdb/dbexport.php,v retrieving revision 1.21 diff -c -r1.21 dbexport.php *** dbexport.php 2 May 2005 15:47:23 -0000 1.21 --- dbexport.php 3 Mar 2007 15:42:43 -0000 *************** *** 69,79 **** // Obtain the pg_dump version number $version = array(); preg_match("/(\d+(?:\.\d+)?)(?:\.\d+)?.*$/", exec($exe . " --version"), $version); ! ! // If we are 7.4 or higher, assume they are using 7.4 pg_dump and ! // set dump schema as well. Also, mixed case dumping has been fixed ! // then.. ! if (((float) $version[1]) >= 7.4) { $cmd .= " -t " . $misc->escapeShellArg($_REQUEST[$_REQUEST['subject']]); // Even though they're using a schema-enabled pg_dump, the backend database // may not support schemas. --- 69,84 ---- // Obtain the pg_dump version number $version = array(); preg_match("/(\d+(?:\.\d+)?)(?:\.\d+)?.*$/", exec($exe . " --version"), $version); ! ! // Starting in 8.2, -n and -t are orthagonal, so we now schema qualify ! // the table name in the -t argument and quote both identifiers ! if ( ((float) $version[1]) >= 8.2 ) { ! $cmd .= " -t " . $misc->escapeShellArg('"' . $_REQUEST['schema'] . '"') . "." . $misc->escapeShellArg('"' . $_REQUEST[$_REQUEST['subject']] .'"'); ! } ! elseif ( ((float) $version[1]) >= 7.4 ) { ! // If we are 7.4 or higher, assume they are using 7.4 pg_dump and ! // set dump schema as well. Also, mixed case dumping has been fixed ! // then.. $cmd .= " -t " . $misc->escapeShellArg($_REQUEST[$_REQUEST['subject']]); // Even though they're using a schema-enabled pg_dump, the backend database // may not support schemas. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=418980&aid=1660510&group_id=37132 |