diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/adodb-postgres64.inc.php | 18 | ||||
| -rw-r--r-- | drivers/adodb-postgres7.inc.php | 18 |
2 files changed, 33 insertions, 3 deletions
diff --git a/drivers/adodb-postgres64.inc.php b/drivers/adodb-postgres64.inc.php index acca56f0..896458d7 100644 --- a/drivers/adodb-postgres64.inc.php +++ b/drivers/adodb-postgres64.inc.php @@ -470,6 +470,21 @@ a different OID if a database must be reloaded. */ #return "($date+interval'$dayFraction days')"; } + /** + * Generate the SQL to retrieve MetaColumns data + * @param string $table Table name + * @param string $schema Schema name (can be blank) + * @return string SQL statement to execute + */ + protected function _generateMetaColumnsSQL($table, $schema) + { + if ($schema) { + return sprintf($this->metaColumnsSQL1, $table, $table, $schema); + } + else { + return sprintf($this->metaColumnsSQL, $table, $table, $schema); + } + } // for schema support, pass in the $table param "$schema.$tabname". // converts field names to lowercase, $upper is ignored @@ -488,8 +503,7 @@ a different OID if a database must be reloaded. */ $ADODB_FETCH_MODE = ADODB_FETCH_NUM; if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false); - if ($schema) $rs = $this->Execute(sprintf($this->metaColumnsSQL1,$table,$table,$schema)); - else $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table,$table,$table)); + $rs = $this->Execute($this->_generateMetaColumnsSQL($table, $schema)); if (isset($savem)) $this->SetFetchMode($savem); $ADODB_FETCH_MODE = $save; diff --git a/drivers/adodb-postgres7.inc.php b/drivers/adodb-postgres7.inc.php index 6cb7226f..6efc599b 100644 --- a/drivers/adodb-postgres7.inc.php +++ b/drivers/adodb-postgres7.inc.php @@ -126,7 +126,23 @@ class ADODB_postgres7 extends ADODB_postgres64 { } return $sql; } - */ + */ + + /** + * Generate the SQL to retrieve MetaColumns data + * @param string $table Table name + * @param string $schema Schema name (can be blank) + * @return string SQL statement to execute + */ + protected function _generateMetaColumnsSQL($table, $schema) + { + if ($schema) { + return sprintf($this->metaColumnsSQL1, $table, $table, $table, $schema); + } + else { + return sprintf($this->metaColumnsSQL, $table, $table, $schema); + } + } /** * @returns assoc array where keys are tables, and values are foreign keys |
