Commit 7e1c763d authored by zYne's avatar zYne

fixed pgsql import driver

parent b6e8c400
...@@ -88,7 +88,7 @@ class Doctrine_Import_Pgsql extends Doctrine_Import ...@@ -88,7 +88,7 @@ class Doctrine_Import_Pgsql extends Doctrine_Import
WHERE oid IN ( WHERE oid IN (
SELECT indexrelid SELECT indexrelid
FROM pg_index, pg_class FROM pg_index, pg_class
WHERE pg_class.relname=%s WHERE pg_class.relname = %s
AND pg_class.oid=pg_index.indrelid AND pg_class.oid=pg_index.indrelid
AND indisunique != 't' AND indisunique != 't'
AND indisprimary != 't' AND indisprimary != 't'
...@@ -148,8 +148,10 @@ class Doctrine_Import_Pgsql extends Doctrine_Import ...@@ -148,8 +148,10 @@ class Doctrine_Import_Pgsql extends Doctrine_Import
*/ */
public function listTableColumns($table) public function listTableColumns($table)
{ {
$table = $this->conn->quote($table);
$query = sprintf($this->sql['listTableColumns'], $table);
$result = $this->conn->fetchAssoc($query);
$result = $this->dbh->query($this->sql['listTableColumns'])->fetchAll(PDO::FETCH_ASSOC);
$columns = array(); $columns = array();
foreach ($result as $key => $val) { foreach ($result as $key => $val) {
if ($val['type'] === 'varchar') { if ($val['type'] === 'varchar') {
...@@ -190,7 +192,7 @@ class Doctrine_Import_Pgsql extends Doctrine_Import ...@@ -190,7 +192,7 @@ class Doctrine_Import_Pgsql extends Doctrine_Import
*/ */
public function listTables($database = null) public function listTables($database = null)
{ {
return $this->dbh->query($this->sql['listTables'])->fetchAll(PDO::FETCH_ASSOC); return $this->conn->fetchAssoc($this->sql['listTables']);
} }
/** /**
* lists table triggers * lists table triggers
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment