-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
Copy pathpg_catalog
6101 lines (5688 loc) · 464 KB
/
pg_catalog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# LogicTest: local
# Set the distsql_workmem to the default production value because of a problem
# with losing 'name' attribute when spilling to disk (#78547).
statement ok
SET distsql_workmem = '64MiB'
# Verify pg_catalog database handles mutation statements correctly.
query error database "pg_catalog" does not exist
ALTER DATABASE pg_catalog RENAME TO not_pg_catalog
statement error schema cannot be modified: "pg_catalog"
CREATE TABLE pg_catalog.t (x INT)
query error database "pg_catalog" does not exist
DROP DATABASE pg_catalog
query TTTTIT
SHOW TABLES FROM pg_catalog
----
pg_catalog pg_aggregate table admin NULL NULL
pg_catalog pg_am table admin NULL NULL
pg_catalog pg_amop table admin NULL NULL
pg_catalog pg_amproc table admin NULL NULL
pg_catalog pg_attrdef table admin NULL NULL
pg_catalog pg_attribute table admin NULL NULL
pg_catalog pg_auth_members table admin NULL NULL
pg_catalog pg_authid table admin NULL NULL
pg_catalog pg_available_extension_versions table admin NULL NULL
pg_catalog pg_available_extensions table admin NULL NULL
pg_catalog pg_cast table admin NULL NULL
pg_catalog pg_class table admin NULL NULL
pg_catalog pg_collation table admin NULL NULL
pg_catalog pg_config table admin NULL NULL
pg_catalog pg_constraint table admin NULL NULL
pg_catalog pg_conversion table admin NULL NULL
pg_catalog pg_cursors table admin NULL NULL
pg_catalog pg_database table admin NULL NULL
pg_catalog pg_db_role_setting table admin NULL NULL
pg_catalog pg_default_acl table admin NULL NULL
pg_catalog pg_depend table admin NULL NULL
pg_catalog pg_description table admin NULL NULL
pg_catalog pg_enum table admin NULL NULL
pg_catalog pg_event_trigger table admin NULL NULL
pg_catalog pg_extension table admin NULL NULL
pg_catalog pg_file_settings table admin NULL NULL
pg_catalog pg_foreign_data_wrapper table admin NULL NULL
pg_catalog pg_foreign_server table admin NULL NULL
pg_catalog pg_foreign_table table admin NULL NULL
pg_catalog pg_group table admin NULL NULL
pg_catalog pg_hba_file_rules table admin NULL NULL
pg_catalog pg_index table admin NULL NULL
pg_catalog pg_indexes table admin NULL NULL
pg_catalog pg_inherits table admin NULL NULL
pg_catalog pg_init_privs table admin NULL NULL
pg_catalog pg_language table admin NULL NULL
pg_catalog pg_largeobject table admin NULL NULL
pg_catalog pg_largeobject_metadata table admin NULL NULL
pg_catalog pg_locks table admin NULL NULL
pg_catalog pg_matviews table admin NULL NULL
pg_catalog pg_namespace table admin NULL NULL
pg_catalog pg_opclass table admin NULL NULL
pg_catalog pg_operator table admin NULL NULL
pg_catalog pg_opfamily table admin NULL NULL
pg_catalog pg_partitioned_table table admin NULL NULL
pg_catalog pg_policies table admin NULL NULL
pg_catalog pg_policy table admin NULL NULL
pg_catalog pg_prepared_statements table admin NULL NULL
pg_catalog pg_prepared_xacts table admin NULL NULL
pg_catalog pg_proc table admin NULL NULL
pg_catalog pg_publication table admin NULL NULL
pg_catalog pg_publication_rel table admin NULL NULL
pg_catalog pg_publication_tables table admin NULL NULL
pg_catalog pg_range table admin NULL NULL
pg_catalog pg_replication_origin table admin NULL NULL
pg_catalog pg_replication_origin_status table admin NULL NULL
pg_catalog pg_replication_slots table admin NULL NULL
pg_catalog pg_rewrite table admin NULL NULL
pg_catalog pg_roles table admin NULL NULL
pg_catalog pg_rules table admin NULL NULL
pg_catalog pg_seclabel table admin NULL NULL
pg_catalog pg_seclabels table admin NULL NULL
pg_catalog pg_sequence table admin NULL NULL
pg_catalog pg_sequences table admin NULL NULL
pg_catalog pg_settings table admin NULL NULL
pg_catalog pg_shadow table admin NULL NULL
pg_catalog pg_shdepend table admin NULL NULL
pg_catalog pg_shdescription table admin NULL NULL
pg_catalog pg_shmem_allocations table admin NULL NULL
pg_catalog pg_shseclabel table admin NULL NULL
pg_catalog pg_stat_activity table admin NULL NULL
pg_catalog pg_stat_all_indexes table admin NULL NULL
pg_catalog pg_stat_all_tables table admin NULL NULL
pg_catalog pg_stat_archiver table admin NULL NULL
pg_catalog pg_stat_bgwriter table admin NULL NULL
pg_catalog pg_stat_database table admin NULL NULL
pg_catalog pg_stat_database_conflicts table admin NULL NULL
pg_catalog pg_stat_gssapi table admin NULL NULL
pg_catalog pg_stat_progress_analyze table admin NULL NULL
pg_catalog pg_stat_progress_basebackup table admin NULL NULL
pg_catalog pg_stat_progress_cluster table admin NULL NULL
pg_catalog pg_stat_progress_create_index table admin NULL NULL
pg_catalog pg_stat_progress_vacuum table admin NULL NULL
pg_catalog pg_stat_replication table admin NULL NULL
pg_catalog pg_stat_slru table admin NULL NULL
pg_catalog pg_stat_ssl table admin NULL NULL
pg_catalog pg_stat_subscription table admin NULL NULL
pg_catalog pg_stat_sys_indexes table admin NULL NULL
pg_catalog pg_stat_sys_tables table admin NULL NULL
pg_catalog pg_stat_user_functions table admin NULL NULL
pg_catalog pg_stat_user_indexes table admin NULL NULL
pg_catalog pg_stat_user_tables table admin NULL NULL
pg_catalog pg_stat_wal_receiver table admin NULL NULL
pg_catalog pg_stat_xact_all_tables table admin NULL NULL
pg_catalog pg_stat_xact_sys_tables table admin NULL NULL
pg_catalog pg_stat_xact_user_functions table admin NULL NULL
pg_catalog pg_stat_xact_user_tables table admin NULL NULL
pg_catalog pg_statio_all_indexes table admin NULL NULL
pg_catalog pg_statio_all_sequences table admin NULL NULL
pg_catalog pg_statio_all_tables table admin NULL NULL
pg_catalog pg_statio_sys_indexes table admin NULL NULL
pg_catalog pg_statio_sys_sequences table admin NULL NULL
pg_catalog pg_statio_sys_tables table admin NULL NULL
pg_catalog pg_statio_user_indexes table admin NULL NULL
pg_catalog pg_statio_user_sequences table admin NULL NULL
pg_catalog pg_statio_user_tables table admin NULL NULL
pg_catalog pg_statistic table admin NULL NULL
pg_catalog pg_statistic_ext table admin NULL NULL
pg_catalog pg_statistic_ext_data table admin NULL NULL
pg_catalog pg_stats table admin NULL NULL
pg_catalog pg_stats_ext table admin NULL NULL
pg_catalog pg_subscription table admin NULL NULL
pg_catalog pg_subscription_rel table admin NULL NULL
pg_catalog pg_tables table admin NULL NULL
pg_catalog pg_tablespace table admin NULL NULL
pg_catalog pg_timezone_abbrevs table admin NULL NULL
pg_catalog pg_timezone_names table admin NULL NULL
pg_catalog pg_transform table admin NULL NULL
pg_catalog pg_trigger table admin NULL NULL
pg_catalog pg_ts_config table admin NULL NULL
pg_catalog pg_ts_config_map table admin NULL NULL
pg_catalog pg_ts_dict table admin NULL NULL
pg_catalog pg_ts_parser table admin NULL NULL
pg_catalog pg_ts_template table admin NULL NULL
pg_catalog pg_type table admin NULL NULL
pg_catalog pg_user table admin NULL NULL
pg_catalog pg_user_mapping table admin NULL NULL
pg_catalog pg_user_mappings table admin NULL NULL
pg_catalog pg_views table admin NULL NULL
# Verify "pg_catalog" is a regular db name
statement ok
CREATE DATABASE other_db
statement ok
ALTER DATABASE other_db RENAME TO pg_catalog
statement error database "pg_catalog" already exists
CREATE DATABASE pg_catalog
statement ok
DROP DATABASE pg_catalog
# the following query checks that the planDataSource instantiated from
# a virtual table in the FROM clause is properly deallocated even when
# query preparation causes an error. #9853
query error unknown function
SELECT * FROM pg_catalog.pg_class c WHERE nonexistent_function()
# Verify pg_catalog handles reflection correctly.
query TTTTIT
SHOW TABLES FROM test.pg_catalog
----
pg_catalog pg_aggregate table admin NULL NULL
pg_catalog pg_am table admin NULL NULL
pg_catalog pg_amop table admin NULL NULL
pg_catalog pg_amproc table admin NULL NULL
pg_catalog pg_attrdef table admin NULL NULL
pg_catalog pg_attribute table admin NULL NULL
pg_catalog pg_auth_members table admin NULL NULL
pg_catalog pg_authid table admin NULL NULL
pg_catalog pg_available_extension_versions table admin NULL NULL
pg_catalog pg_available_extensions table admin NULL NULL
pg_catalog pg_cast table admin NULL NULL
pg_catalog pg_class table admin NULL NULL
pg_catalog pg_collation table admin NULL NULL
pg_catalog pg_config table admin NULL NULL
pg_catalog pg_constraint table admin NULL NULL
pg_catalog pg_conversion table admin NULL NULL
pg_catalog pg_cursors table admin NULL NULL
pg_catalog pg_database table admin NULL NULL
pg_catalog pg_db_role_setting table admin NULL NULL
pg_catalog pg_default_acl table admin NULL NULL
pg_catalog pg_depend table admin NULL NULL
pg_catalog pg_description table admin NULL NULL
pg_catalog pg_enum table admin NULL NULL
pg_catalog pg_event_trigger table admin NULL NULL
pg_catalog pg_extension table admin NULL NULL
pg_catalog pg_file_settings table admin NULL NULL
pg_catalog pg_foreign_data_wrapper table admin NULL NULL
pg_catalog pg_foreign_server table admin NULL NULL
pg_catalog pg_foreign_table table admin NULL NULL
pg_catalog pg_group table admin NULL NULL
pg_catalog pg_hba_file_rules table admin NULL NULL
pg_catalog pg_index table admin NULL NULL
pg_catalog pg_indexes table admin NULL NULL
pg_catalog pg_inherits table admin NULL NULL
pg_catalog pg_init_privs table admin NULL NULL
pg_catalog pg_language table admin NULL NULL
pg_catalog pg_largeobject table admin NULL NULL
pg_catalog pg_largeobject_metadata table admin NULL NULL
pg_catalog pg_locks table admin NULL NULL
pg_catalog pg_matviews table admin NULL NULL
pg_catalog pg_namespace table admin NULL NULL
pg_catalog pg_opclass table admin NULL NULL
pg_catalog pg_operator table admin NULL NULL
pg_catalog pg_opfamily table admin NULL NULL
pg_catalog pg_partitioned_table table admin NULL NULL
pg_catalog pg_policies table admin NULL NULL
pg_catalog pg_policy table admin NULL NULL
pg_catalog pg_prepared_statements table admin NULL NULL
pg_catalog pg_prepared_xacts table admin NULL NULL
pg_catalog pg_proc table admin NULL NULL
pg_catalog pg_publication table admin NULL NULL
pg_catalog pg_publication_rel table admin NULL NULL
pg_catalog pg_publication_tables table admin NULL NULL
pg_catalog pg_range table admin NULL NULL
pg_catalog pg_replication_origin table admin NULL NULL
pg_catalog pg_replication_origin_status table admin NULL NULL
pg_catalog pg_replication_slots table admin NULL NULL
pg_catalog pg_rewrite table admin NULL NULL
pg_catalog pg_roles table admin NULL NULL
pg_catalog pg_rules table admin NULL NULL
pg_catalog pg_seclabel table admin NULL NULL
pg_catalog pg_seclabels table admin NULL NULL
pg_catalog pg_sequence table admin NULL NULL
pg_catalog pg_sequences table admin NULL NULL
pg_catalog pg_settings table admin NULL NULL
pg_catalog pg_shadow table admin NULL NULL
pg_catalog pg_shdepend table admin NULL NULL
pg_catalog pg_shdescription table admin NULL NULL
pg_catalog pg_shmem_allocations table admin NULL NULL
pg_catalog pg_shseclabel table admin NULL NULL
pg_catalog pg_stat_activity table admin NULL NULL
pg_catalog pg_stat_all_indexes table admin NULL NULL
pg_catalog pg_stat_all_tables table admin NULL NULL
pg_catalog pg_stat_archiver table admin NULL NULL
pg_catalog pg_stat_bgwriter table admin NULL NULL
pg_catalog pg_stat_database table admin NULL NULL
pg_catalog pg_stat_database_conflicts table admin NULL NULL
pg_catalog pg_stat_gssapi table admin NULL NULL
pg_catalog pg_stat_progress_analyze table admin NULL NULL
pg_catalog pg_stat_progress_basebackup table admin NULL NULL
pg_catalog pg_stat_progress_cluster table admin NULL NULL
pg_catalog pg_stat_progress_create_index table admin NULL NULL
pg_catalog pg_stat_progress_vacuum table admin NULL NULL
pg_catalog pg_stat_replication table admin NULL NULL
pg_catalog pg_stat_slru table admin NULL NULL
pg_catalog pg_stat_ssl table admin NULL NULL
pg_catalog pg_stat_subscription table admin NULL NULL
pg_catalog pg_stat_sys_indexes table admin NULL NULL
pg_catalog pg_stat_sys_tables table admin NULL NULL
pg_catalog pg_stat_user_functions table admin NULL NULL
pg_catalog pg_stat_user_indexes table admin NULL NULL
pg_catalog pg_stat_user_tables table admin NULL NULL
pg_catalog pg_stat_wal_receiver table admin NULL NULL
pg_catalog pg_stat_xact_all_tables table admin NULL NULL
pg_catalog pg_stat_xact_sys_tables table admin NULL NULL
pg_catalog pg_stat_xact_user_functions table admin NULL NULL
pg_catalog pg_stat_xact_user_tables table admin NULL NULL
pg_catalog pg_statio_all_indexes table admin NULL NULL
pg_catalog pg_statio_all_sequences table admin NULL NULL
pg_catalog pg_statio_all_tables table admin NULL NULL
pg_catalog pg_statio_sys_indexes table admin NULL NULL
pg_catalog pg_statio_sys_sequences table admin NULL NULL
pg_catalog pg_statio_sys_tables table admin NULL NULL
pg_catalog pg_statio_user_indexes table admin NULL NULL
pg_catalog pg_statio_user_sequences table admin NULL NULL
pg_catalog pg_statio_user_tables table admin NULL NULL
pg_catalog pg_statistic table admin NULL NULL
pg_catalog pg_statistic_ext table admin NULL NULL
pg_catalog pg_statistic_ext_data table admin NULL NULL
pg_catalog pg_stats table admin NULL NULL
pg_catalog pg_stats_ext table admin NULL NULL
pg_catalog pg_subscription table admin NULL NULL
pg_catalog pg_subscription_rel table admin NULL NULL
pg_catalog pg_tables table admin NULL NULL
pg_catalog pg_tablespace table admin NULL NULL
pg_catalog pg_timezone_abbrevs table admin NULL NULL
pg_catalog pg_timezone_names table admin NULL NULL
pg_catalog pg_transform table admin NULL NULL
pg_catalog pg_trigger table admin NULL NULL
pg_catalog pg_ts_config table admin NULL NULL
pg_catalog pg_ts_config_map table admin NULL NULL
pg_catalog pg_ts_dict table admin NULL NULL
pg_catalog pg_ts_parser table admin NULL NULL
pg_catalog pg_ts_template table admin NULL NULL
pg_catalog pg_type table admin NULL NULL
pg_catalog pg_user table admin NULL NULL
pg_catalog pg_user_mapping table admin NULL NULL
pg_catalog pg_user_mappings table admin NULL NULL
pg_catalog pg_views table admin NULL NULL
query TT colnames
SHOW CREATE TABLE pg_catalog.pg_namespace
----
table_name create_statement
pg_catalog.pg_namespace CREATE TABLE pg_catalog.pg_namespace (
oid OID NULL,
nspname NAME NOT NULL,
nspowner OID NULL,
nspacl STRING[] NULL
)
query TTBTTTB colnames
SHOW COLUMNS FROM pg_catalog.pg_namespace
----
column_name data_type is_nullable column_default generation_expression indices is_hidden
oid OID true NULL · {} false
nspname NAME false NULL · {} false
nspowner OID true NULL · {} false
nspacl STRING[] true NULL · {} false
query TTBITTBBB colnames
SHOW INDEXES FROM pg_catalog.pg_namespace
----
table_name index_name non_unique seq_in_index column_name direction storing implicit visible
query TTTTB colnames
SHOW CONSTRAINTS FROM pg_catalog.pg_namespace
----
table_name constraint_name constraint_type details validated
query TTTTTB colnames
SHOW GRANTS ON pg_catalog.pg_namespace
----
database_name schema_name table_name grantee privilege_type is_grantable
test pg_catalog pg_namespace public SELECT false
# Verify selecting from pg_catalog.
statement ok
CREATE DATABASE constraint_db
statement ok
CREATE TABLE constraint_db.t1 (
p FLOAT PRIMARY KEY,
a INT UNIQUE,
b INT,
c INT DEFAULT 12,
d VARCHAR(5),
e BIT(5),
f DECIMAL(10,7),
g INT AS (a * b) STORED,
h CHAR(12)[],
i VARCHAR(20)[],
j "char",
k VARCHAR(10) COLLATE sv,
l INT AS (a * b) VIRTUAL,
m INT GENERATED ALWAYS AS IDENTITY,
n INT GENERATED BY DEFAULT AS IDENTITY,
UNIQUE INDEX index_key(b, c)
)
statement ok
CREATE TABLE constraint_db.t2 (
t1_ID INT,
CONSTRAINT fk FOREIGN KEY (t1_ID) REFERENCES constraint_db.t1(a),
INDEX (t1_ID)
)
statement ok
CREATE TABLE constraint_db.t3 (
a INT,
b INT CHECK (b > 11),
c STRING DEFAULT 'FOO' CHECK (c != ''),
CONSTRAINT fk FOREIGN KEY (a, b) REFERENCES constraint_db.t1(b, c),
INDEX (a, b DESC) STORING (c)
)
statement ok
CREATE VIEW constraint_db.v1 AS SELECT p,a,b,c FROM constraint_db.t1
statement ok
SET experimental_enable_unique_without_index_constraints = true
statement ok
CREATE TABLE constraint_db.t4 (
a INT UNIQUE WITHOUT INDEX,
b FLOAT,
c STRING,
CONSTRAINT uwi_b_c UNIQUE WITHOUT INDEX (b, c),
CONSTRAINT uwi_b_partial UNIQUE WITHOUT INDEX (b) WHERE c = 'foo'
)
statement ok
CREATE TABLE constraint_db.t5 (
a INT REFERENCES constraint_db.t4(a) ON DELETE CASCADE,
b FLOAT,
c STRING,
CONSTRAINT fk_b_c FOREIGN KEY (b, c) REFERENCES constraint_db.t4(b, c) MATCH FULL ON UPDATE RESTRICT
)
statement ok
CREATE TYPE constraint_db.mytype AS ENUM ('foo', 'bar', 'baz')
statement ok
CREATE TABLE constraint_db.t6 (
a INT,
b INT,
c STRING,
m constraint_db.mytype,
INDEX ((a + b))
);
CREATE INDEX ON constraint_db.t6 (lower(c), (a + b));
CREATE UNIQUE INDEX ON constraint_db.t6 (lower(c));
CREATE INDEX ON constraint_db.t6 ((m = 'foo')) WHERE m = 'foo'
## pg_catalog.pg_namespace
query OTOT colnames
SELECT * FROM pg_catalog.pg_namespace
----
oid nspname nspowner nspacl
1445254017 crdb_internal NULL NULL
155990598 information_schema NULL NULL
2154378761 pg_catalog NULL NULL
1098122499 pg_extension NULL NULL
105 public 2310524507 NULL
# Verify that we can still see the schemas even if we don't have any privilege
# on the current database.
statement ok
REVOKE ALL ON DATABASE test FROM public;
REVOKE ALL ON DATABASE test FROM testuser
user testuser
query OTOT colnames
SELECT * FROM pg_catalog.pg_namespace
----
oid nspname nspowner nspacl
1445254017 crdb_internal NULL NULL
155990598 information_schema NULL NULL
2154378761 pg_catalog NULL NULL
1098122499 pg_extension NULL NULL
105 public 2310524507 NULL
user root
statement ok
GRANT CONNECT ON DATABASE test TO public
## pg_catalog.pg_database
query OTOITTBB colnames
SELECT oid, datname, datdba, encoding, datcollate, datctype, datistemplate, datallowconn
FROM pg_catalog.pg_database
ORDER BY oid
----
oid datname datdba encoding datcollate datctype datistemplate datallowconn
1 system 3233629770 6 en_US.utf8 en_US.utf8 false true
100 defaultdb 1546506610 6 en_US.utf8 en_US.utf8 false true
102 postgres 1546506610 6 en_US.utf8 en_US.utf8 false true
104 test 1546506610 6 en_US.utf8 en_US.utf8 false true
108 constraint_db 1546506610 6 en_US.utf8 en_US.utf8 false true
query OTIOIIOT colnames
SELECT oid, datname, datconnlimit, datlastsysoid, datfrozenxid, datminmxid, dattablespace, datacl
FROM pg_catalog.pg_database
ORDER BY oid
----
oid datname datconnlimit datlastsysoid datfrozenxid datminmxid dattablespace datacl
1 system -1 0 NULL NULL 0 NULL
100 defaultdb -1 0 NULL NULL 0 NULL
102 postgres -1 0 NULL NULL 0 NULL
104 test -1 0 NULL NULL 0 NULL
108 constraint_db -1 0 NULL NULL 0 NULL
user testuser
# Should be globally visible
query OTIOIIOT colnames
SELECT oid, datname, datconnlimit, datlastsysoid, datfrozenxid, datminmxid, dattablespace, datacl
FROM pg_catalog.pg_database
ORDER BY oid LIMIT 1
----
oid datname datconnlimit datlastsysoid datfrozenxid datminmxid dattablespace datacl
1 system -1 0 NULL NULL 0 NULL
user root
## pg_catalog.pg_tables
statement ok
SET DATABASE = constraint_db
query TTTTBBBB colnames
SELECT * FROM constraint_db.pg_catalog.pg_tables WHERE schemaname = 'public'
----
schemaname tablename tableowner tablespace hasindexes hasrules hastriggers rowsecurity
public t1 root NULL true false false false
public t2 root NULL true false false false
public t3 root NULL true false false false
public t4 root NULL true false false false
public t5 root NULL true false false false
public t6 root NULL true false false false
query TB colnames
SELECT tablename, hasindexes FROM pg_catalog.pg_tables WHERE schemaname = 'information_schema' AND tablename LIKE '%table%'
----
tablename hasindexes
constraint_table_usage false
foreign_table_options false
foreign_tables false
role_table_grants false
table_constraints false
table_constraints_extensions false
table_privileges false
tables false
tables_extensions false
tablespaces false
tablespaces_extensions false
view_table_usage false
## pg_catalog.pg_tablespace
query OTOTT colnames
SELECT oid, spcname, spcowner, spcacl, spcoptions FROM pg_tablespace
----
oid spcname spcowner spcacl spcoptions
0 pg_default NULL NULL NULL
## pg_catalog.pg_views
query TTTT colnames
SELECT * FROM pg_catalog.pg_views
----
schemaname viewname viewowner definition
public v1 root SELECT p, a, b, c FROM constraint_db.public.t1
## pg_catalog.pg_matviews
statement ok
CREATE MATERIALIZED VIEW mv1 AS SELECT 1
query TTTTBBT colnames
SELECT * FROM pg_catalog.pg_matviews
----
schemaname matviewname matviewowner tablespace hasindexes ispopulated definition
public mv1 root NULL false true SELECT 1
## pg_catalog.pg_class
query OTOOOOOOO colnames
SELECT c.oid, relname, relnamespace, reltype, reloftype, relowner, relam, relfilenode, reltablespace
FROM pg_catalog.pg_class c
JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid
WHERE n.nspname = 'public'
----
oid relname relnamespace reltype reloftype relowner relam relfilenode reltablespace
110 t1 109 100110 0 1546506610 2631952481 0 0
3687884466 t1_pkey 109 0 0 1546506610 2631952481 0 0
3687884465 t1_a_key 109 0 0 1546506610 2631952481 0 0
3687884464 index_key 109 0 0 1546506610 2631952481 0 0
111 t1_m_seq 109 100111 0 1546506610 0 0 0
112 t1_n_seq 109 100112 0 1546506610 0 0 0
113 t2 109 100113 0 1546506610 2631952481 0 0
2955071325 t2_pkey 109 0 0 1546506610 2631952481 0 0
2955071326 t2_t1_id_idx 109 0 0 1546506610 2631952481 0 0
114 t3 109 100114 0 1546506610 2631952481 0 0
2695335054 t3_pkey 109 0 0 1546506610 2631952481 0 0
2695335053 t3_a_b_idx 109 0 0 1546506610 2631952481 0 0
115 v1 109 100115 0 1546506610 0 0 0
116 t4 109 100116 0 1546506610 2631952481 0 0
3214807592 t4_pkey 109 0 0 1546506610 2631952481 0 0
117 t5 109 100117 0 1546506610 2631952481 0 0
1869730585 t5_pkey 109 0 0 1546506610 2631952481 0 0
120 t6 109 100120 0 1546506610 2631952481 0 0
2129466852 t6_pkey 109 0 0 1546506610 2631952481 0 0
2129466855 t6_expr_idx 109 0 0 1546506610 2631952481 0 0
2129466854 t6_expr_expr1_idx 109 0 0 1546506610 2631952481 0 0
2129466848 t6_expr_key 109 0 0 1546506610 2631952481 0 0
2129466850 t6_expr_idx1 109 0 0 1546506610 2631952481 0 0
121 mv1 109 100121 0 1546506610 0 0 0
784389845 mv1_pkey 109 0 0 1546506610 2631952481 0 0
query TIRIOBBT colnames
SELECT relname, relpages, reltuples, relallvisible, reltoastrelid, relhasindex, relisshared, relpersistence
FROM pg_catalog.pg_class c
JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid
WHERE n.nspname = 'public'
----
relname relpages reltuples relallvisible reltoastrelid relhasindex relisshared relpersistence
t1 NULL NULL 0 0 true false p
t1_pkey NULL NULL 0 0 false false p
t1_a_key NULL NULL 0 0 false false p
index_key NULL NULL 0 0 false false p
t1_m_seq NULL NULL 0 0 true false p
t1_n_seq NULL NULL 0 0 true false p
t2 NULL NULL 0 0 true false p
t2_pkey NULL NULL 0 0 false false p
t2_t1_id_idx NULL NULL 0 0 false false p
t3 NULL NULL 0 0 true false p
t3_pkey NULL NULL 0 0 false false p
t3_a_b_idx NULL NULL 0 0 false false p
v1 NULL NULL 0 0 false false p
t4 NULL NULL 0 0 true false p
t4_pkey NULL NULL 0 0 false false p
t5 NULL NULL 0 0 true false p
t5_pkey NULL NULL 0 0 false false p
t6 NULL NULL 0 0 true false p
t6_pkey NULL NULL 0 0 false false p
t6_expr_idx NULL NULL 0 0 false false p
t6_expr_expr1_idx NULL NULL 0 0 false false p
t6_expr_key NULL NULL 0 0 false false p
t6_expr_idx1 NULL NULL 0 0 false false p
mv1 NULL NULL 0 0 true false p
mv1_pkey NULL NULL 0 0 false false p
query TBTIIBB colnames
SELECT relname, relistemp, relkind, relnatts, relchecks, relhasoids, relhaspkey
FROM pg_catalog.pg_class c
JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid
WHERE n.nspname = 'public'
----
relname relistemp relkind relnatts relchecks relhasoids relhaspkey
t1 false r 15 0 false true
t1_pkey false i 1 0 false false
t1_a_key false i 1 0 false false
index_key false i 2 0 false false
t1_m_seq false S 1 0 false true
t1_n_seq false S 1 0 false true
t2 false r 2 0 false true
t2_pkey false i 1 0 false false
t2_t1_id_idx false i 1 0 false false
t3 false r 4 2 false true
t3_pkey false i 1 0 false false
t3_a_b_idx false i 2 0 false false
v1 false v 4 0 false false
t4 false r 4 0 false true
t4_pkey false i 1 0 false false
t5 false r 4 0 false true
t5_pkey false i 1 0 false false
t6 false r 5 0 false true
t6_pkey false i 1 0 false false
t6_expr_idx false i 1 0 false false
t6_expr_expr1_idx false i 2 0 false false
t6_expr_key false i 1 0 false false
t6_expr_idx1 false i 1 0 false false
mv1 false m 2 0 false true
mv1_pkey false i 1 0 false false
query TBBBITT colnames
SELECT relname, relhasrules, relhastriggers, relhassubclass, relfrozenxid, relacl, reloptions
FROM pg_catalog.pg_class c
JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid
WHERE n.nspname = 'public'
----
relname relhasrules relhastriggers relhassubclass relfrozenxid relacl reloptions
t1 false false false 0 NULL NULL
t1_pkey false false false 0 NULL NULL
t1_a_key false false false 0 NULL NULL
index_key false false false 0 NULL NULL
t1_m_seq false false false 0 NULL NULL
t1_n_seq false false false 0 NULL NULL
t2 false false false 0 NULL NULL
t2_pkey false false false 0 NULL NULL
t2_t1_id_idx false false false 0 NULL NULL
t3 false false false 0 NULL NULL
t3_pkey false false false 0 NULL NULL
t3_a_b_idx false false false 0 NULL NULL
v1 false false false 0 NULL NULL
t4 false false false 0 NULL NULL
t4_pkey false false false 0 NULL NULL
t5 false false false 0 NULL NULL
t5_pkey false false false 0 NULL NULL
t6 false false false 0 NULL NULL
t6_pkey false false false 0 NULL NULL
t6_expr_idx false false false 0 NULL NULL
t6_expr_expr1_idx false false false 0 NULL NULL
t6_expr_key false false false 0 NULL NULL
t6_expr_idx1 false false false 0 NULL NULL
mv1 false false false 0 NULL NULL
mv1_pkey false false false 0 NULL NULL
## pg_catalog.pg_attribute
query OTTOIIIII colnames,rowsort
SELECT attrelid, c.relname, attname, atttypid, attstattarget, attlen, attnum, attndims, attcacheoff
FROM pg_catalog.pg_attribute a
JOIN pg_catalog.pg_class c ON a.attrelid = c.oid
JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid
WHERE n.nspname = 'public'
----
attrelid relname attname atttypid attstattarget attlen attnum attndims attcacheoff
110 t1 p 701 0 8 1 0 -1
110 t1 a 20 0 8 2 0 -1
110 t1 b 20 0 8 3 0 -1
110 t1 c 20 0 8 4 0 -1
110 t1 d 1043 0 -1 5 0 -1
110 t1 e 1560 0 -1 6 0 -1
110 t1 f 1700 0 -1 7 0 -1
110 t1 g 20 0 8 8 0 -1
110 t1 h 1014 0 -1 9 0 -1
110 t1 i 1015 0 -1 10 0 -1
110 t1 j 18 0 1 11 0 -1
110 t1 k 1043 0 -1 12 0 -1
110 t1 l 20 0 8 13 0 -1
110 t1 m 20 0 8 14 0 -1
110 t1 n 20 0 8 15 0 -1
3687884466 t1_pkey p 701 0 8 1 0 -1
3687884465 t1_a_key a 20 0 8 1 0 -1
3687884464 index_key b 20 0 8 1 0 -1
3687884464 index_key c 20 0 8 2 0 -1
111 t1_m_seq value 20 0 8 1 0 -1
112 t1_n_seq value 20 0 8 1 0 -1
113 t2 t1_id 20 0 8 1 0 -1
113 t2 rowid 20 0 8 2 0 -1
2955071325 t2_pkey rowid 20 0 8 1 0 -1
2955071326 t2_t1_id_idx t1_id 20 0 8 1 0 -1
114 t3 a 20 0 8 1 0 -1
114 t3 b 20 0 8 2 0 -1
114 t3 c 25 0 -1 3 0 -1
114 t3 rowid 20 0 8 4 0 -1
2695335054 t3_pkey rowid 20 0 8 1 0 -1
2695335053 t3_a_b_idx a 20 0 8 1 0 -1
2695335053 t3_a_b_idx b 20 0 8 2 0 -1
2695335053 t3_a_b_idx c 25 0 -1 3 0 -1
115 v1 p 701 0 8 1 0 -1
115 v1 a 20 0 8 2 0 -1
115 v1 b 20 0 8 3 0 -1
115 v1 c 20 0 8 4 0 -1
116 t4 a 20 0 8 1 0 -1
116 t4 b 701 0 8 2 0 -1
116 t4 c 25 0 -1 3 0 -1
116 t4 rowid 20 0 8 4 0 -1
3214807592 t4_pkey rowid 20 0 8 1 0 -1
117 t5 a 20 0 8 1 0 -1
117 t5 b 701 0 8 2 0 -1
117 t5 c 25 0 -1 3 0 -1
117 t5 rowid 20 0 8 4 0 -1
1869730585 t5_pkey rowid 20 0 8 1 0 -1
120 t6 a 20 0 8 1 0 -1
120 t6 b 20 0 8 2 0 -1
120 t6 c 25 0 -1 3 0 -1
120 t6 m 100118 0 -1 4 0 -1
120 t6 rowid 20 0 8 6 0 -1
2129466852 t6_pkey rowid 20 0 8 1 0 -1
2129466855 t6_expr_idx crdb_internal_idx_expr 20 0 8 1 0 -1
2129466854 t6_expr_expr1_idx crdb_internal_idx_expr_1 25 0 -1 1 0 -1
2129466854 t6_expr_expr1_idx crdb_internal_idx_expr 20 0 8 2 0 -1
2129466848 t6_expr_key crdb_internal_idx_expr_1 25 0 -1 1 0 -1
2129466850 t6_expr_idx1 crdb_internal_idx_expr_2 16 0 1 1 0 -1
121 mv1 ?column? 20 0 8 1 0 -1
121 mv1 rowid 20 0 8 2 0 -1
784389845 mv1_pkey rowid 20 0 8 1 0 -1
query TTIBTTBBTT colnames,rowsort
SELECT c.relname, attname, atttypmod, attbyval, attstorage, attalign, attnotnull, atthasdef, attidentity, attgenerated
FROM pg_catalog.pg_attribute a
JOIN pg_catalog.pg_class c ON a.attrelid = c.oid
JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid
WHERE n.nspname = 'public'
----
relname attname atttypmod attbyval attstorage attalign attnotnull atthasdef attidentity attgenerated
t1 p -1 NULL NULL NULL true false · ·
t1 a -1 NULL NULL NULL false false · ·
t1 b -1 NULL NULL NULL false false · ·
t1 c -1 NULL NULL NULL false true · ·
t1 d 9 NULL NULL NULL false false · ·
t1 e 5 NULL NULL NULL false false · ·
t1 f 655371 NULL NULL NULL false false · ·
t1 g -1 NULL NULL NULL false false · s
t1 h 16 NULL NULL NULL false false · ·
t1 i 24 NULL NULL NULL false false · ·
t1 j -1 NULL NULL NULL false false · ·
t1 k 14 NULL NULL NULL false false · ·
t1 l -1 NULL NULL NULL false false · v
t1 m -1 NULL NULL NULL true true a ·
t1 n -1 NULL NULL NULL true true b ·
t1_pkey p -1 NULL NULL NULL true false · ·
t1_a_key a -1 NULL NULL NULL false false · ·
index_key b -1 NULL NULL NULL false false · ·
index_key c -1 NULL NULL NULL false true · ·
t1_m_seq value -1 NULL NULL NULL true false · ·
t1_n_seq value -1 NULL NULL NULL true false · ·
t2 t1_id -1 NULL NULL NULL false false · ·
t2 rowid -1 NULL NULL NULL true true · ·
t2_pkey rowid -1 NULL NULL NULL true true · ·
t2_t1_id_idx t1_id -1 NULL NULL NULL false false · ·
t3 a -1 NULL NULL NULL false false · ·
t3 b -1 NULL NULL NULL false false · ·
t3 c -1 NULL NULL NULL false true · ·
t3 rowid -1 NULL NULL NULL true true · ·
t3_pkey rowid -1 NULL NULL NULL true true · ·
t3_a_b_idx a -1 NULL NULL NULL false false · ·
t3_a_b_idx b -1 NULL NULL NULL false false · ·
t3_a_b_idx c -1 NULL NULL NULL false true · ·
v1 p -1 NULL NULL NULL false false · ·
v1 a -1 NULL NULL NULL false false · ·
v1 b -1 NULL NULL NULL false false · ·
v1 c -1 NULL NULL NULL false false · ·
t4 a -1 NULL NULL NULL false false · ·
t4 b -1 NULL NULL NULL false false · ·
t4 c -1 NULL NULL NULL false false · ·
t4 rowid -1 NULL NULL NULL true true · ·
t4_pkey rowid -1 NULL NULL NULL true true · ·
t5 a -1 NULL NULL NULL false false · ·
t5 b -1 NULL NULL NULL false false · ·
t5 c -1 NULL NULL NULL false false · ·
t5 rowid -1 NULL NULL NULL true true · ·
t5_pkey rowid -1 NULL NULL NULL true true · ·
t6 a -1 NULL NULL NULL false false · ·
t6 b -1 NULL NULL NULL false false · ·
t6 c -1 NULL NULL NULL false false · ·
t6 m -1 NULL NULL NULL false false · ·
t6 rowid -1 NULL NULL NULL true true · ·
t6_pkey rowid -1 NULL NULL NULL true true · ·
t6_expr_idx crdb_internal_idx_expr -1 NULL NULL NULL false false · v
t6_expr_expr1_idx crdb_internal_idx_expr_1 -1 NULL NULL NULL false false · v
t6_expr_expr1_idx crdb_internal_idx_expr -1 NULL NULL NULL false false · v
t6_expr_key crdb_internal_idx_expr_1 -1 NULL NULL NULL false false · v
t6_expr_idx1 crdb_internal_idx_expr_2 -1 NULL NULL NULL false false · v
mv1 ?column? -1 NULL NULL NULL false false · ·
mv1 rowid -1 NULL NULL NULL true true · ·
mv1_pkey rowid -1 NULL NULL NULL true true · ·
query TTBBITTT colnames,rowsort
SELECT c.relname, attname, attisdropped, attislocal, attinhcount, attacl, attoptions, attfdwoptions
FROM pg_catalog.pg_attribute a
JOIN pg_catalog.pg_class c ON a.attrelid = c.oid
JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid
WHERE n.nspname = 'public'
----
relname attname attisdropped attislocal attinhcount attacl attoptions attfdwoptions
t1 p false true 0 NULL NULL NULL
t1 a false true 0 NULL NULL NULL
t1 b false true 0 NULL NULL NULL
t1 c false true 0 NULL NULL NULL
t1 d false true 0 NULL NULL NULL
t1 e false true 0 NULL NULL NULL
t1 f false true 0 NULL NULL NULL
t1 g false true 0 NULL NULL NULL
t1 h false true 0 NULL NULL NULL
t1 i false true 0 NULL NULL NULL
t1 j false true 0 NULL NULL NULL
t1 k false true 0 NULL NULL NULL
t1 l false true 0 NULL NULL NULL
t1 m false true 0 NULL NULL NULL
t1 n false true 0 NULL NULL NULL
t1_pkey p false true 0 NULL NULL NULL
t1_a_key a false true 0 NULL NULL NULL
index_key b false true 0 NULL NULL NULL
index_key c false true 0 NULL NULL NULL
t1_m_seq value false true 0 NULL NULL NULL
t1_n_seq value false true 0 NULL NULL NULL
t2 t1_id false true 0 NULL NULL NULL
t2 rowid false true 0 NULL NULL NULL
t2_pkey rowid false true 0 NULL NULL NULL
t2_t1_id_idx t1_id false true 0 NULL NULL NULL
t3 a false true 0 NULL NULL NULL
t3 b false true 0 NULL NULL NULL
t3 c false true 0 NULL NULL NULL
t3 rowid false true 0 NULL NULL NULL
t3_pkey rowid false true 0 NULL NULL NULL
t3_a_b_idx a false true 0 NULL NULL NULL
t3_a_b_idx b false true 0 NULL NULL NULL
t3_a_b_idx c false true 0 NULL NULL NULL
v1 p false true 0 NULL NULL NULL
v1 a false true 0 NULL NULL NULL
v1 b false true 0 NULL NULL NULL
v1 c false true 0 NULL NULL NULL
t4 a false true 0 NULL NULL NULL
t4 b false true 0 NULL NULL NULL
t4 c false true 0 NULL NULL NULL
t4 rowid false true 0 NULL NULL NULL
t4_pkey rowid false true 0 NULL NULL NULL
t5 a false true 0 NULL NULL NULL
t5 b false true 0 NULL NULL NULL
t5 c false true 0 NULL NULL NULL
t5 rowid false true 0 NULL NULL NULL
t5_pkey rowid false true 0 NULL NULL NULL
t6 a false true 0 NULL NULL NULL
t6 b false true 0 NULL NULL NULL
t6 c false true 0 NULL NULL NULL
t6 m false true 0 NULL NULL NULL
t6 rowid false true 0 NULL NULL NULL
t6_pkey rowid false true 0 NULL NULL NULL
t6_expr_idx crdb_internal_idx_expr false true 0 NULL NULL NULL
t6_expr_expr1_idx crdb_internal_idx_expr_1 false true 0 NULL NULL NULL
t6_expr_expr1_idx crdb_internal_idx_expr false true 0 NULL NULL NULL
t6_expr_key crdb_internal_idx_expr_1 false true 0 NULL NULL NULL
t6_expr_idx1 crdb_internal_idx_expr_2 false true 0 NULL NULL NULL
mv1 ?column? false true 0 NULL NULL NULL
mv1 rowid false true 0 NULL NULL NULL
mv1_pkey rowid false true 0 NULL NULL NULL
# Check relkind codes.
statement ok
CREATE DATABASE relkinds
statement ok
SET DATABASE = relkinds
statement ok
CREATE TABLE tbl_test (k int primary key, v int)
statement ok
CREATE INDEX tbl_test_v_idx ON tbl_test (v)
statement ok
CREATE VIEW view_test AS SELECT k, v FROM tbl_test ORDER BY v
statement ok
CREATE MATERIALIZED VIEW mv_test AS SELECT 1
statement ok
CREATE SEQUENCE seq_test
query TT
SELECT relname, relkind
FROM pg_catalog.pg_class c
JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid
WHERE n.nspname = 'public'
ORDER BY relname
----
mv_test m
mv_test_pkey i
seq_test S
tbl_test r
tbl_test_pkey i
tbl_test_v_idx i
view_test v
statement ok
DROP DATABASE relkinds
statement ok
SET DATABASE = constraint_db
# Select all columns with collations.
query TTTOT colnames,rowsort
SELECT c.relname, attname, t.typname, attcollation, k.collname
FROM pg_catalog.pg_attribute a
JOIN pg_catalog.pg_class c ON a.attrelid = c.oid
JOIN pg_catalog.pg_type t ON a.atttypid = t.oid
JOIN pg_catalog.pg_collation k ON a.attcollation = k.oid
JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid
WHERE n.nspname = 'public'
----
relname attname typname attcollation collname
t1 d varchar 3403232968 default
t6_expr_key crdb_internal_idx_expr_1 text 3403232968 default
t6_expr_expr1_idx crdb_internal_idx_expr_1 text 3403232968 default
t6 c text 3403232968 default
t5 c text 3403232968 default
t4 c text 3403232968 default
t3_a_b_idx c text 3403232968 default
t3 c text 3403232968 default
t1 j char 3403232968 default
t1 i _varchar 3403232968 default
t1 h _bpchar 3403232968 default
t1 k varchar 999873346 sv
## pg_catalog.pg_am
query OTIIBBBBBBBBBBBOOOOOOOOOOOOOOOOOT colnames
SELECT *
FROM pg_catalog.pg_am
----
oid amname amstrategies amsupport amcanorder amcanorderbyop amcanbackward amcanunique amcanmulticol amoptionalkey amsearcharray amsearchnulls amstorage amclusterable ampredlocks amkeytype aminsert ambeginscan amgettuple amgetbitmap amrescan amendscan ammarkpos amrestrpos ambuild ambuildempty ambulkdelete amvacuumcleanup amcanreturn amcostestimate amoptions amhandler amtype
2631952481 prefix 0 0 true false true true true true true true false false false 0 NULL NULL 0 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL i
4004609370 inverted 0 0 false false false false false false false true false false false 0 NULL NULL 0 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL i
## pg_catalog.pg_attrdef
query OTOITTT colnames,rowsort
SELECT ad.oid, c.relname, adrelid, adnum, adbin, adsrc, pg_get_expr(ad.adbin, ad.adrelid)
FROM pg_catalog.pg_attrdef ad
JOIN pg_catalog.pg_class c ON ad.adrelid = c.oid
JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid
WHERE n.nspname = 'public'
----
oid relname adrelid adnum adbin adsrc pg_get_expr
2306804694 t1 110 4 12 12 12
2306804700 t1 110 14 nextval('public.t1_m_seq'::REGCLASS) nextval('public.t1_m_seq'::REGCLASS) nextval('public.t1_m_seq'::REGCLASS)
2306804701 t1 110 15 nextval('public.t1_n_seq'::REGCLASS) nextval('public.t1_n_seq'::REGCLASS) nextval('public.t1_n_seq'::REGCLASS)
4171354239 t2 113 2 unique_rowid() unique_rowid() unique_rowid()
1221463949 t3 114 3 'FOO'::STRING 'FOO'::STRING 'FOO'::STRING
1221463946 t3 114 4 unique_rowid() unique_rowid() unique_rowid()
1740936492 t4 116 4 unique_rowid() unique_rowid() unique_rowid()
3086013501 t5 117 4 unique_rowid() unique_rowid() unique_rowid()
655595746 t6 120 6 unique_rowid() unique_rowid() unique_rowid()