@@ -2795,45 +2795,105 @@ Argument data types | numeric
27952795Type | func
27962796
27972797\pset tuples_only false
2798- -- check conditional tableam display
2799- -- Create a heap2 table am handler with heapam handler
2798+ -- check conditional am display
2799+ \pset expanded off
2800+ CREATE SCHEMA tableam_display;
2801+ CREATE ROLE regress_display_role;
2802+ ALTER SCHEMA tableam_display OWNER TO regress_display_role;
2803+ SET search_path TO tableam_display;
28002804CREATE ACCESS METHOD heap_psql TYPE TABLE HANDLER heap_tableam_handler;
2805+ SET ROLE TO regress_display_role;
2806+ -- Use only relations with a physical size of zero.
28012807CREATE TABLE tbl_heap_psql(f1 int, f2 char(100)) using heap_psql;
28022808CREATE TABLE tbl_heap(f1 int, f2 char(100)) using heap;
2809+ CREATE VIEW view_heap_psql AS SELECT f1 from tbl_heap_psql;
2810+ CREATE MATERIALIZED VIEW mat_view_heap_psql USING heap_psql AS SELECT f1 from tbl_heap_psql;
28032811\d+ tbl_heap_psql
2804- Table "public .tbl_heap_psql"
2812+ Table "tableam_display .tbl_heap_psql"
28052813 Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
28062814--------+----------------+-----------+----------+---------+----------+--------------+-------------
28072815 f1 | integer | | | | plain | |
28082816 f2 | character(100) | | | | extended | |
28092817
28102818\d+ tbl_heap
2811- Table "public .tbl_heap"
2819+ Table "tableam_display .tbl_heap"
28122820 Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
28132821--------+----------------+-----------+----------+---------+----------+--------------+-------------
28142822 f1 | integer | | | | plain | |
28152823 f2 | character(100) | | | | extended | |
28162824
28172825\set HIDE_TABLEAM off
28182826\d+ tbl_heap_psql
2819- Table "public .tbl_heap_psql"
2827+ Table "tableam_display .tbl_heap_psql"
28202828 Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
28212829--------+----------------+-----------+----------+---------+----------+--------------+-------------
28222830 f1 | integer | | | | plain | |
28232831 f2 | character(100) | | | | extended | |
28242832Access method: heap_psql
28252833
28262834\d+ tbl_heap
2827- Table "public .tbl_heap"
2835+ Table "tableam_display .tbl_heap"
28282836 Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
28292837--------+----------------+-----------+----------+---------+----------+--------------+-------------
28302838 f1 | integer | | | | plain | |
28312839 f2 | character(100) | | | | extended | |
28322840Access method: heap
28332841
2842+ -- AM is displayed for tables, indexes and materialized views.
2843+ \d+
2844+ List of relations
2845+ Schema | Name | Type | Owner | Persistence | Access Method | Size | Description
2846+ -----------------+--------------------+-------------------+----------------------+-------------+---------------+---------+-------------
2847+ tableam_display | mat_view_heap_psql | materialized view | regress_display_role | permanent | heap_psql | 0 bytes |
2848+ tableam_display | tbl_heap | table | regress_display_role | permanent | heap | 0 bytes |
2849+ tableam_display | tbl_heap_psql | table | regress_display_role | permanent | heap_psql | 0 bytes |
2850+ tableam_display | view_heap_psql | view | regress_display_role | permanent | | 0 bytes |
2851+ (4 rows)
2852+
2853+ \dt+
2854+ List of relations
2855+ Schema | Name | Type | Owner | Persistence | Access Method | Size | Description
2856+ -----------------+---------------+-------+----------------------+-------------+---------------+---------+-------------
2857+ tableam_display | tbl_heap | table | regress_display_role | permanent | heap | 0 bytes |
2858+ tableam_display | tbl_heap_psql | table | regress_display_role | permanent | heap_psql | 0 bytes |
2859+ (2 rows)
2860+
2861+ \dm+
2862+ List of relations
2863+ Schema | Name | Type | Owner | Persistence | Access Method | Size | Description
2864+ -----------------+--------------------+-------------------+----------------------+-------------+---------------+---------+-------------
2865+ tableam_display | mat_view_heap_psql | materialized view | regress_display_role | permanent | heap_psql | 0 bytes |
2866+ (1 row)
2867+
2868+ -- But not for views and sequences.
2869+ \dv+
2870+ List of relations
2871+ Schema | Name | Type | Owner | Persistence | Size | Description
2872+ -----------------+----------------+------+----------------------+-------------+---------+-------------
2873+ tableam_display | view_heap_psql | view | regress_display_role | permanent | 0 bytes |
2874+ (1 row)
2875+
28342876\set HIDE_TABLEAM on
2835- DROP TABLE tbl_heap, tbl_heap_psql;
2877+ \d+
2878+ List of relations
2879+ Schema | Name | Type | Owner | Persistence | Size | Description
2880+ -----------------+--------------------+-------------------+----------------------+-------------+---------+-------------
2881+ tableam_display | mat_view_heap_psql | materialized view | regress_display_role | permanent | 0 bytes |
2882+ tableam_display | tbl_heap | table | regress_display_role | permanent | 0 bytes |
2883+ tableam_display | tbl_heap_psql | table | regress_display_role | permanent | 0 bytes |
2884+ tableam_display | view_heap_psql | view | regress_display_role | permanent | 0 bytes |
2885+ (4 rows)
2886+
2887+ RESET ROLE;
2888+ RESET search_path;
2889+ DROP SCHEMA tableam_display CASCADE;
2890+ NOTICE: drop cascades to 4 other objects
2891+ DETAIL: drop cascades to table tableam_display.tbl_heap_psql
2892+ drop cascades to table tableam_display.tbl_heap
2893+ drop cascades to view tableam_display.view_heap_psql
2894+ drop cascades to materialized view tableam_display.mat_view_heap_psql
28362895DROP ACCESS METHOD heap_psql;
2896+ DROP ROLE regress_display_role;
28372897-- test numericlocale (as best we can without control of psql's locale)
28382898\pset format aligned
28392899\pset expanded off
0 commit comments