diff options
Diffstat (limited to 'src/bin/psql')
-rw-r--r-- | src/bin/psql/describe.c | 19 | ||||
-rw-r--r-- | src/bin/psql/tab-complete.c | 5 |
2 files changed, 19 insertions, 5 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index bd7a97bd6f..0a181b01d9 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -1496,7 +1496,24 @@ describeOneTableDetails(const char *schemaname, initPQExpBuffer(&tmpbuf); /* Get general table info */ - if (pset.sversion >= 90500) + if (pset.sversion >= 120000) + { + printfPQExpBuffer(&buf, + "SELECT c.relchecks, c.relkind, c.relhasindex, c.relhasrules, " + "c.relhastriggers, c.relrowsecurity, c.relforcerowsecurity, " + "false AS relhasoids, %s, c.reltablespace, " + "CASE WHEN c.reloftype = 0 THEN '' ELSE c.reloftype::pg_catalog.regtype::pg_catalog.text END, " + "c.relpersistence, c.relreplident\n" + "FROM pg_catalog.pg_class c\n " + "LEFT JOIN pg_catalog.pg_class tc ON (c.reltoastrelid = tc.oid)\n" + "WHERE c.oid = '%s';", + (verbose ? + "pg_catalog.array_to_string(c.reloptions || " + "array(select 'toast.' || x from pg_catalog.unnest(tc.reloptions) x), ', ')\n" + : "''"), + oid); + } + else if (pset.sversion >= 90500) { printfPQExpBuffer(&buf, "SELECT c.relchecks, c.relkind, c.relhasindex, c.relhasrules, " diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 7294824948..9dbd555166 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -1884,9 +1884,6 @@ psql_completion(const char *text, int start, int end) */ else if (Matches("ALTER", "TABLE", MatchAny, "SET", "TABLESPACE")) COMPLETE_WITH_QUERY(Query_for_list_of_tablespaces); - /* If we have ALTER TABLE <sth> SET WITH provide OIDS */ - else if (Matches("ALTER", "TABLE", MatchAny, "SET", "WITH")) - COMPLETE_WITH("OIDS"); /* If we have ALTER TABLE <sth> SET WITHOUT provide CLUSTER or OIDS */ else if (Matches("ALTER", "TABLE", MatchAny, "SET", "WITHOUT")) COMPLETE_WITH("CLUSTER", "OIDS"); @@ -2155,7 +2152,7 @@ psql_completion(const char *text, int start, int end) /* Handle COPY [BINARY] <sth> FROM|TO filename */ else if (Matches("COPY|\\copy", MatchAny, "FROM|TO", MatchAny) || Matches("COPY", "BINARY", MatchAny, "FROM|TO", MatchAny)) - COMPLETE_WITH("BINARY", "OIDS", "DELIMITER", "NULL", "CSV", + COMPLETE_WITH("BINARY", "DELIMITER", "NULL", "CSV", "ENCODING"); /* Handle COPY [BINARY] <sth> FROM|TO filename CSV */ |