From 8f1f3f68cb6347586b350f9e60221e90a9ab8dd9 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 24 Jun 2007 08:36:20 +0000 Subject: [PATCH] "fix to detect if a table depends on a sequence to not try to drop it separate, thanks to Peter Eisentraut " --- phpgwapi/inc/adodb/datadict/datadict-postgres.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpgwapi/inc/adodb/datadict/datadict-postgres.inc.php b/phpgwapi/inc/adodb/datadict/datadict-postgres.inc.php index fd1aa46b06..c313e4aba3 100644 --- a/phpgwapi/inc/adodb/datadict/datadict-postgres.inc.php +++ b/phpgwapi/inc/adodb/datadict/datadict-postgres.inc.php @@ -289,7 +289,7 @@ class ADODB2_postgres extends ADODB_DataDict { $seq = $this->connection->GetOne("SELECT relname FROM pg_class WHERE NOT relname ~ 'pg_.*' AND relname LIKE $tabname AND relkind='S'"); // check if a tables depends on the sequenz and it therefor cant and dont need to be droped separatly - if (!$seq || $this->connection->GetOne("SELECT relname FROM pg_class JOIN pg_depend ON pg_class.relfilenode=pg_depend.objid WHERE relname='$seq' AND relkind='S' AND deptype='i'")) { + if (!$seq || $this->connection->GetOne("SELECT relname FROM pg_class JOIN pg_depend ON pg_class.oid=pg_depend.objid WHERE relname='$seq' AND relkind='S' AND deptype='i'")) { return False; } return "DROP SEQUENCE ".$seq;