Bug #76916 [NEW]: pg_meta_data Does Not Respect PostgreSQL search_path

From: Date: Fri, 21 Sep 2018 15:44:15 +0000
Subject: Bug #76916 [NEW]: pg_meta_data Does Not Respect PostgreSQL search_path
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217185@lists.php.net to get a copy of this message
From: klaxian at gmail dot com Operating system: Linux PHP version: 7.1.22 Package: PostgreSQL related Bug Type: Bug Bug description:pg_meta_data Does Not Respect PostgreSQL search_path Description: ------------ When querying for data about a PostgreSQL table, pg_meta_data() does not respect PostgreSQL's search_path setting. When the specified table is not explicitly qualified with a schema, the public schema is always assumed. This is hard-coded in the pgsql extension. https://github.com/php/php-src/blob/master/ext/pgsql/pgsql.c#L5530 Test script: --------------- pg_meta_data($link, 'test'); // always looks for "public.test" Expected result: ---------------- When a table name is not explicitly qualified with a schema name, the server search_path setting should be used to determine the correct table. Actual result: -------------- When a table name is not explicitly qualified with a schema name, the public schema is always assumed. -- Edit bug report at https://bugs.php.net/bug.php?id=76916&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76916&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76916&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76916&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=76916&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=76916&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=76916&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=76916&r=needscript Try newer version: https://bugs.php.net/fix.php?id=76916&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=76916&r=support Expected behavior: https://bugs.php.net/fix.php?id=76916&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=76916&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=76916&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=76916&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76916&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=76916&r=dst IIS Stability: https://bugs.php.net/fix.php?id=76916&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=76916&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=76916&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=76916&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=76916&r=mysqlcfg

« previous php.bugs (#217185) next »