From ee55ec8f1616317fe4a407c483d4ea14a7f7ac68 Mon Sep 17 00:00:00 2001 From: "Guillaume (ioguix) de Rorthais" Date: Fri, 30 Oct 2009 14:06:06 +0100 Subject: [PATCH] When creating table with WITHOUT OIDS not checked, behaviour was left to the db default setting. Force WITH OIDS if WITHOUT OIDS is unchecked. Remove useless hasWithoutOIDs() as well as 7.3 -> 8.4 support it. --- classes/database/Postgres.php | 15 +++++++-------- tables.php | 6 ++---- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/classes/database/Postgres.php b/classes/database/Postgres.php index ded8bfca..68e7a7ca 100755 --- a/classes/database/Postgres.php +++ b/classes/database/Postgres.php @@ -1406,12 +1406,10 @@ class Postgres extends ADODB_base { */ // Handle WITHOUT OIDS - if ($this->hasWithoutOIDs()) { - if ($this->hasObjectID($table)) - $sql .= " WITH OIDS"; - else - $sql .= " WITHOUT OIDS"; - } + if ($this->hasObjectID($table)) + $sql .= " WITH OIDS"; + else + $sql .= " WITHOUT OIDS"; $sql .= ";\n"; @@ -1727,8 +1725,10 @@ class Postgres extends ADODB_base { $sql .= ")"; // WITHOUT OIDS - if ($this->hasWithoutOIDs() && $withoutoids) + if ($withoutoids) $sql .= ' WITHOUT OIDS'; + else + $sql .= ' WITH OIDS'; // Tablespace if ($this->hasTablespaces() && $tablespace != '') { @@ -7829,7 +7829,6 @@ class Postgres extends ADODB_base { function hasVariables() { return true; } function hasViewColumnRename() { return true; } function hasVirtualTransactionId() { return true; } - function hasWithoutOIDs() { return true; } function hasAlterDatabase() { return $this->hasAlterDatabaseRename(); } function hasDatabaseCollation() { return true; } function hasMagicTypes() { return true; } diff --git a/tables.php b/tables.php index 23a03471..d91fd6bf 100644 --- a/tables.php +++ b/tables.php @@ -46,10 +46,8 @@ echo "\t\n\t\t{$lang['strnumcols']}\n"; echo "\t\t_maxNameLen}\" value=\"", htmlspecialchars($_REQUEST['fields']), "\" />\n\t\n"; - if ($data->hasWithoutOIDs()) { - echo "\t\n\t\t{$lang['stroptions']}\n"; - echo "\t\t\n\t\n"; - } + echo "\t\n\t\t{$lang['stroptions']}\n"; + echo "\t\t\n\t\n"; // Tablespace (if there are any) if ($data->hasTablespaces() && $tablespaces->recordCount() > 0) { -- 2.39.5