From: Jakub Vrana Date: Thu, 1 Feb 2018 15:45:31 +0000 (+0100) Subject: Don't use ctid as it's not stable X-Git-Tag: v4.6.0~18 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=763e66a148861bd6522741dfea1a1d916a2ba36b;p=adminer.git Don't use ctid as it's not stable --- diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index 6d468169..ed69ecd6 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -264,7 +264,7 @@ ORDER BY 1"; function table_status($name = "") { $return = array(); - foreach (get_rows("SELECT c.relname AS \"Name\", CASE c.relkind WHEN 'r' THEN 'table' WHEN 'm' THEN 'materialized view' ELSE 'view' END AS \"Engine\", pg_relation_size(c.oid) AS \"Data_length\", pg_total_relation_size(c.oid) - pg_relation_size(c.oid) AS \"Index_length\", obj_description(c.oid, 'pg_class') AS \"Comment\", CASE WHEN c.relhasoids THEN 'oid' ELSE 'ctid' END AS \"Oid\", c.reltuples as \"Rows\", n.nspname + foreach (get_rows("SELECT c.relname AS \"Name\", CASE c.relkind WHEN 'r' THEN 'table' WHEN 'm' THEN 'materialized view' ELSE 'view' END AS \"Engine\", pg_relation_size(c.oid) AS \"Data_length\", pg_total_relation_size(c.oid) - pg_relation_size(c.oid) AS \"Index_length\", obj_description(c.oid, 'pg_class') AS \"Comment\", CASE WHEN c.relhasoids THEN 'oid' ELSE '' END AS \"Oid\", c.reltuples as \"Rows\", n.nspname FROM pg_class c JOIN pg_namespace n ON(n.nspname = current_schema() AND n.oid = c.relnamespace) WHERE relkind IN ('r', 'm', 'v', 'f') @@ -690,7 +690,7 @@ AND typelem = 0" $return_parts[] = "CONSTRAINT " . idf_escape($fkey_name) . " $fkey[definition] " . ($fkey['deferrable'] ? 'DEFERRABLE' : 'NOT DEFERRABLE'); } - $return .= implode(",\n ", $return_parts) . "\n) WITH (oids = " . ($status['Oid'] == 'oid' ? 'true' : 'false') . ");"; + $return .= implode(",\n ", $return_parts) . "\n) WITH (oids = " . ($status['Oid'] ? 'true' : 'false') . ");"; // "basic" indexes after table definition foreach ($indexes as $index_name => $index) {