diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index 9424da0358d..303df0068c7 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -4983,7 +4983,6 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys " WHEN " CppAsString2(RELKIND_MATVIEW) " THEN '%s'" " 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'" @@ -4997,7 +4996,6 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys gettext_noop("materialized view"), gettext_noop("index"), gettext_noop("sequence"), - gettext_noop("special"), gettext_noop("TOAST table"), gettext_noop("foreign table"), gettext_noop("partitioned table"), @@ -5012,10 +5010,10 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys if (isGPDB7000OrLater()) { appendPQExpBuffer(&buf, ", CASE c.relam"); - appendPQExpBuffer(&buf, " WHEN %d THEN '%s'", HEAP_TABLE_AM_OID, gettext_noop("heap")); appendPQExpBuffer(&buf, " WHEN %d THEN '%s'", AO_ROW_TABLE_AM_OID, gettext_noop("append only")); appendPQExpBuffer(&buf, " WHEN %d THEN '%s'", AO_COLUMN_TABLE_AM_OID, gettext_noop("append only columnar")); - appendPQExpBuffer(&buf, " WHEN %d THEN '%s'", BTREE_AM_OID, gettext_noop("btree")); + appendPQExpBuffer(&buf, " ELSE (SELECT amname FROM pg_am WHERE pg_am.oid=c.relam)"); + appendPQExpBuffer(&buf, " END as \"%s\"\n", gettext_noop("Storage")); } else diff --git a/src/test/regress/expected/psql.out b/src/test/regress/expected/psql.out index 85567284c69..b388887ebd1 100644 --- a/src/test/regress/expected/psql.out +++ b/src/test/regress/expected/psql.out @@ -2866,21 +2866,21 @@ Access method: heap -- AM is displayed for tables, indexes and materialized views. \d+ - List of relations - Schema | Name | Type | Owner | Storage | Persistence | Access method | Size | Description ------------------+--------------------+-------------------+----------------------+---------+-------------+---------------+---------+------------- - tableam_display | mat_view_heap_psql | materialized view | regress_display_role | | permanent | heap_psql | 0 bytes | - tableam_display | tbl_heap | table | regress_display_role | heap | permanent | heap | 0 bytes | - tableam_display | tbl_heap_psql | table | regress_display_role | | permanent | heap_psql | 0 bytes | - tableam_display | view_heap_psql | view | regress_display_role | | permanent | | 0 bytes | + List of relations + Schema | Name | Type | Owner | Storage | Persistence | Access method | Size | Description +-----------------+--------------------+-------------------+----------------------+-----------+-------------+---------------+---------+------------- + tableam_display | mat_view_heap_psql | materialized view | regress_display_role | heap_psql | permanent | heap_psql | 0 bytes | + tableam_display | tbl_heap | table | regress_display_role | heap | permanent | heap | 0 bytes | + tableam_display | tbl_heap_psql | table | regress_display_role | heap_psql | permanent | heap_psql | 0 bytes | + tableam_display | view_heap_psql | view | regress_display_role | | permanent | | 0 bytes | (4 rows) \dt+ - List of relations - Schema | Name | Type | Owner | Storage | Persistence | Access method | Size | Description ------------------+---------------+-------+----------------------+---------+-------------+---------------+---------+------------- - tableam_display | tbl_heap | table | regress_display_role | heap | permanent | heap | 0 bytes | - tableam_display | tbl_heap_psql | table | regress_display_role | | permanent | heap_psql | 0 bytes | + List of relations + Schema | Name | Type | Owner | Storage | Persistence | Access method | Size | Description +-----------------+---------------+-------+----------------------+-----------+-------------+---------------+---------+------------- + tableam_display | tbl_heap | table | regress_display_role | heap | permanent | heap | 0 bytes | + tableam_display | tbl_heap_psql | table | regress_display_role | heap_psql | permanent | heap_psql | 0 bytes | (2 rows) \dm+ @@ -2900,13 +2900,13 @@ Access method: heap \set HIDE_TABLEAM on \d+ - List of relations - Schema | Name | Type | Owner | Storage | Persistence | Size | Description ------------------+--------------------+-------------------+----------------------+---------+-------------+---------+------------- - tableam_display | mat_view_heap_psql | materialized view | regress_display_role | | permanent | 0 bytes | - tableam_display | tbl_heap | table | regress_display_role | heap | permanent | 0 bytes | - tableam_display | tbl_heap_psql | table | regress_display_role | | permanent | 0 bytes | - tableam_display | view_heap_psql | view | regress_display_role | | permanent | 0 bytes | + List of relations + Schema | Name | Type | Owner | Storage | Persistence | Size | Description +-----------------+--------------------+-------------------+----------------------+-----------+-------------+---------+------------- + tableam_display | mat_view_heap_psql | materialized view | regress_display_role | heap_psql | permanent | 0 bytes | + tableam_display | tbl_heap | table | regress_display_role | heap | permanent | 0 bytes | + tableam_display | tbl_heap_psql | table | regress_display_role | heap_psql | permanent | 0 bytes | + tableam_display | view_heap_psql | view | regress_display_role | | permanent | 0 bytes | (4 rows) RESET ROLE; diff --git a/src/test/singlenode_regress/expected/psql.out b/src/test/singlenode_regress/expected/psql.out index 85567284c69..b388887ebd1 100644 --- a/src/test/singlenode_regress/expected/psql.out +++ b/src/test/singlenode_regress/expected/psql.out @@ -2866,21 +2866,21 @@ Access method: heap -- AM is displayed for tables, indexes and materialized views. \d+ - List of relations - Schema | Name | Type | Owner | Storage | Persistence | Access method | Size | Description ------------------+--------------------+-------------------+----------------------+---------+-------------+---------------+---------+------------- - tableam_display | mat_view_heap_psql | materialized view | regress_display_role | | permanent | heap_psql | 0 bytes | - tableam_display | tbl_heap | table | regress_display_role | heap | permanent | heap | 0 bytes | - tableam_display | tbl_heap_psql | table | regress_display_role | | permanent | heap_psql | 0 bytes | - tableam_display | view_heap_psql | view | regress_display_role | | permanent | | 0 bytes | + List of relations + Schema | Name | Type | Owner | Storage | Persistence | Access method | Size | Description +-----------------+--------------------+-------------------+----------------------+-----------+-------------+---------------+---------+------------- + tableam_display | mat_view_heap_psql | materialized view | regress_display_role | heap_psql | permanent | heap_psql | 0 bytes | + tableam_display | tbl_heap | table | regress_display_role | heap | permanent | heap | 0 bytes | + tableam_display | tbl_heap_psql | table | regress_display_role | heap_psql | permanent | heap_psql | 0 bytes | + tableam_display | view_heap_psql | view | regress_display_role | | permanent | | 0 bytes | (4 rows) \dt+ - List of relations - Schema | Name | Type | Owner | Storage | Persistence | Access method | Size | Description ------------------+---------------+-------+----------------------+---------+-------------+---------------+---------+------------- - tableam_display | tbl_heap | table | regress_display_role | heap | permanent | heap | 0 bytes | - tableam_display | tbl_heap_psql | table | regress_display_role | | permanent | heap_psql | 0 bytes | + List of relations + Schema | Name | Type | Owner | Storage | Persistence | Access method | Size | Description +-----------------+---------------+-------+----------------------+-----------+-------------+---------------+---------+------------- + tableam_display | tbl_heap | table | regress_display_role | heap | permanent | heap | 0 bytes | + tableam_display | tbl_heap_psql | table | regress_display_role | heap_psql | permanent | heap_psql | 0 bytes | (2 rows) \dm+ @@ -2900,13 +2900,13 @@ Access method: heap \set HIDE_TABLEAM on \d+ - List of relations - Schema | Name | Type | Owner | Storage | Persistence | Size | Description ------------------+--------------------+-------------------+----------------------+---------+-------------+---------+------------- - tableam_display | mat_view_heap_psql | materialized view | regress_display_role | | permanent | 0 bytes | - tableam_display | tbl_heap | table | regress_display_role | heap | permanent | 0 bytes | - tableam_display | tbl_heap_psql | table | regress_display_role | | permanent | 0 bytes | - tableam_display | view_heap_psql | view | regress_display_role | | permanent | 0 bytes | + List of relations + Schema | Name | Type | Owner | Storage | Persistence | Size | Description +-----------------+--------------------+-------------------+----------------------+-----------+-------------+---------+------------- + tableam_display | mat_view_heap_psql | materialized view | regress_display_role | heap_psql | permanent | 0 bytes | + tableam_display | tbl_heap | table | regress_display_role | heap | permanent | 0 bytes | + tableam_display | tbl_heap_psql | table | regress_display_role | heap_psql | permanent | 0 bytes | + tableam_display | view_heap_psql | view | regress_display_role | | permanent | 0 bytes | (4 rows) RESET ROLE;