@@ -2795,45 +2795,105 @@ Argument data types | numeric
2795
2795
Type | func
2796
2796
2797
2797
\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;
2800
2804
CREATE 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.
2801
2807
CREATE TABLE tbl_heap_psql(f1 int, f2 char(100)) using heap_psql;
2802
2808
CREATE 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;
2803
2811
\d+ tbl_heap_psql
2804
- Table "public .tbl_heap_psql"
2812
+ Table "tableam_display .tbl_heap_psql"
2805
2813
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
2806
2814
--------+----------------+-----------+----------+---------+----------+--------------+-------------
2807
2815
f1 | integer | | | | plain | |
2808
2816
f2 | character(100) | | | | extended | |
2809
2817
2810
2818
\d+ tbl_heap
2811
- Table "public .tbl_heap"
2819
+ Table "tableam_display .tbl_heap"
2812
2820
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
2813
2821
--------+----------------+-----------+----------+---------+----------+--------------+-------------
2814
2822
f1 | integer | | | | plain | |
2815
2823
f2 | character(100) | | | | extended | |
2816
2824
2817
2825
\set HIDE_TABLEAM off
2818
2826
\d+ tbl_heap_psql
2819
- Table "public .tbl_heap_psql"
2827
+ Table "tableam_display .tbl_heap_psql"
2820
2828
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
2821
2829
--------+----------------+-----------+----------+---------+----------+--------------+-------------
2822
2830
f1 | integer | | | | plain | |
2823
2831
f2 | character(100) | | | | extended | |
2824
2832
Access method: heap_psql
2825
2833
2826
2834
\d+ tbl_heap
2827
- Table "public .tbl_heap"
2835
+ Table "tableam_display .tbl_heap"
2828
2836
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
2829
2837
--------+----------------+-----------+----------+---------+----------+--------------+-------------
2830
2838
f1 | integer | | | | plain | |
2831
2839
f2 | character(100) | | | | extended | |
2832
2840
Access method: heap
2833
2841
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
+
2834
2876
\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
2836
2895
DROP ACCESS METHOD heap_psql;
2896
+ DROP ROLE regress_display_role;
2837
2897
-- test numericlocale (as best we can without control of psql's locale)
2838
2898
\pset format aligned
2839
2899
\pset expanded off
0 commit comments