" WHEN " CppAsString2(RELKIND_INDEX) " THEN '%s'"
" WHEN " CppAsString2(RELKIND_SEQUENCE) " THEN '%s'"
" WHEN 's' THEN '%s'"
+ " WHEN " CppAsString2(RELKIND_TOASTVALUE) " THEN '%s'"
" WHEN " CppAsString2(RELKIND_FOREIGN_TABLE) " THEN '%s'"
" WHEN " CppAsString2(RELKIND_PARTITIONED_TABLE) " THEN '%s'"
" WHEN " CppAsString2(RELKIND_PARTITIONED_INDEX) " THEN '%s'"
gettext_noop("index"),
gettext_noop("sequence"),
gettext_noop("special"),
+ gettext_noop("TOAST table"),
gettext_noop("foreign table"),
gettext_noop("partitioned table"),
gettext_noop("partitioned index"),
appendPQExpBufferStr(&buf, "\nWHERE c.relkind IN (");
if (showTables)
+ {
appendPQExpBufferStr(&buf, CppAsString2(RELKIND_RELATION) ","
CppAsString2(RELKIND_PARTITIONED_TABLE) ",");
+ /* with 'S' or a pattern, allow 't' to match TOAST tables too */
+ if (showSystem || pattern)
+ appendPQExpBufferStr(&buf, CppAsString2(RELKIND_TOASTVALUE) ",");
+ }
if (showViews)
appendPQExpBufferStr(&buf, CppAsString2(RELKIND_VIEW) ",");
if (showMatViews)
if (!showSystem && !pattern)
appendPQExpBufferStr(&buf, " AND n.nspname <> 'pg_catalog'\n"
+ " AND n.nspname !~ '^pg_toast'\n"
" AND n.nspname <> 'information_schema'\n");
- /*
- * TOAST objects are suppressed unconditionally. Since we don't provide
- * any way to select RELKIND_TOASTVALUE above, we would never show toast
- * tables in any case; it seems a bit confusing to allow their indexes to
- * be shown. Use plain \d if you really need to look at a TOAST
- * table/index.
- */
- appendPQExpBufferStr(&buf, " AND n.nspname !~ '^pg_toast'\n");
-
processSQLNamePattern(pset.db, &buf, pattern, true, false,
"n.nspname", "c.relname", NULL,
"pg_catalog.pg_table_is_visible(c.oid)");
if (!pattern)
appendPQExpBufferStr(&buf, " AND n.nspname <> 'pg_catalog'\n"
+ " AND n.nspname !~ '^pg_toast'\n"
" AND n.nspname <> 'information_schema'\n");
- /*
- * TOAST objects are suppressed unconditionally. Since we don't provide
- * any way to select RELKIND_TOASTVALUE above, we would never show toast
- * tables in any case; it seems a bit confusing to allow their indexes to
- * be shown. Use plain \d if you really need to look at a TOAST
- * table/index.
- */
- appendPQExpBufferStr(&buf, " AND n.nspname !~ '^pg_toast'\n");
-
processSQLNamePattern(pset.db, &buf, pattern, true, false,
"n.nspname", "c.relname", NULL,
"pg_catalog.pg_table_is_visible(c.oid)");
Indexes:
"pg_toast_2619_index" PRIMARY KEY, btree (chunk_id, chunk_seq)
+\dt pg_toast.pg_toast_2619
+ List of relations
+ Schema | Name | Type | Owner
+----------+---------------+-------------+----------
+ pg_toast | pg_toast_2619 | TOAST table | postgres
+(1 row)
+
+\di pg_toast.pg_toast_2619_index
+ List of relations
+ Schema | Name | Type | Owner | Table
+----------+---------------------+-------+----------+---------------
+ pg_toast | pg_toast_2619_index | index | postgres | pg_toast_2619
+(1 row)
+
-- check printing info about access methods
\dA
List of access methods