-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
information_schema
5337 lines (5022 loc) · 479 KB
/
information_schema
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
# 3node-tenant is blocked from running this file because of the absence of
# the tenant table for tenants. Legacy schema changer is also skipped, because
# some of the queries relating internal state will be impacted in terms of
# descriptor versions, etc..
# LogicTest: !3node-tenant-default-configs !local-legacy-schema-changer
# Verify information_schema database handles mutation statements correctly.
query error database "information_schema" does not exist
ALTER DATABASE information_schema RENAME TO not_information_schema
statement error schema cannot be modified: "information_schema"
CREATE TABLE information_schema.t (x INT)
query error database "information_schema" does not exist
DROP DATABASE information_schema
query TTTTIT
SHOW TABLES FROM information_schema
----
information_schema administrable_role_authorizations table admin NULL NULL
information_schema applicable_roles table admin NULL NULL
information_schema attributes table admin NULL NULL
information_schema character_sets table admin NULL NULL
information_schema check_constraint_routine_usage table admin NULL NULL
information_schema check_constraints table admin NULL NULL
information_schema collation_character_set_applicability table admin NULL NULL
information_schema collations table admin NULL NULL
information_schema column_column_usage table admin NULL NULL
information_schema column_domain_usage table admin NULL NULL
information_schema column_options table admin NULL NULL
information_schema column_privileges table admin NULL NULL
information_schema column_statistics table admin NULL NULL
information_schema column_udt_usage table admin NULL NULL
information_schema columns table admin NULL NULL
information_schema columns_extensions table admin NULL NULL
information_schema constraint_column_usage table admin NULL NULL
information_schema constraint_table_usage table admin NULL NULL
information_schema data_type_privileges table admin NULL NULL
information_schema domain_constraints table admin NULL NULL
information_schema domain_udt_usage table admin NULL NULL
information_schema domains table admin NULL NULL
information_schema element_types table admin NULL NULL
information_schema enabled_roles table admin NULL NULL
information_schema engines table admin NULL NULL
information_schema events table admin NULL NULL
information_schema files table admin NULL NULL
information_schema foreign_data_wrapper_options table admin NULL NULL
information_schema foreign_data_wrappers table admin NULL NULL
information_schema foreign_server_options table admin NULL NULL
information_schema foreign_servers table admin NULL NULL
information_schema foreign_table_options table admin NULL NULL
information_schema foreign_tables table admin NULL NULL
information_schema information_schema_catalog_name table admin NULL NULL
information_schema key_column_usage table admin NULL NULL
information_schema keywords table admin NULL NULL
information_schema optimizer_trace table admin NULL NULL
information_schema parameters table admin NULL NULL
information_schema partitions table admin NULL NULL
information_schema plugins table admin NULL NULL
information_schema processlist table admin NULL NULL
information_schema profiling table admin NULL NULL
information_schema referential_constraints table admin NULL NULL
information_schema resource_groups table admin NULL NULL
information_schema role_column_grants table admin NULL NULL
information_schema role_routine_grants table admin NULL NULL
information_schema role_table_grants table admin NULL NULL
information_schema role_udt_grants table admin NULL NULL
information_schema role_usage_grants table admin NULL NULL
information_schema routine_privileges table admin NULL NULL
information_schema routines table admin NULL NULL
information_schema schema_privileges table admin NULL NULL
information_schema schemata table admin NULL NULL
information_schema schemata_extensions table admin NULL NULL
information_schema sequences table admin NULL NULL
information_schema session_variables table admin NULL NULL
information_schema sql_features table admin NULL NULL
information_schema sql_implementation_info table admin NULL NULL
information_schema sql_parts table admin NULL NULL
information_schema sql_sizing table admin NULL NULL
information_schema st_geometry_columns table admin NULL NULL
information_schema st_spatial_reference_systems table admin NULL NULL
information_schema st_units_of_measure table admin NULL NULL
information_schema statistics table admin NULL NULL
information_schema table_constraints table admin NULL NULL
information_schema table_constraints_extensions table admin NULL NULL
information_schema table_privileges table admin NULL NULL
information_schema tables table admin NULL NULL
information_schema tables_extensions table admin NULL NULL
information_schema tablespaces table admin NULL NULL
information_schema tablespaces_extensions table admin NULL NULL
information_schema transforms table admin NULL NULL
information_schema triggered_update_columns table admin NULL NULL
information_schema triggers table admin NULL NULL
information_schema type_privileges table admin NULL NULL
information_schema udt_privileges table admin NULL NULL
information_schema usage_privileges table admin NULL NULL
information_schema user_attributes table admin NULL NULL
information_schema user_defined_types table admin NULL NULL
information_schema user_mapping_options table admin NULL NULL
information_schema user_mappings table admin NULL NULL
information_schema user_privileges table admin NULL NULL
information_schema view_column_usage table admin NULL NULL
information_schema view_routine_usage table admin NULL NULL
information_schema view_table_usage table admin NULL NULL
information_schema views table admin NULL NULL
# Verify that the name is not special for databases.
statement ok
CREATE DATABASE other_db
statement ok
ALTER DATABASE other_db RENAME TO information_schema
statement error database "information_schema" already exists
CREATE DATABASE information_schema
statement ok
DROP DATABASE information_schema CASCADE
# Verify information_schema tables handle mutation statements correctly.
statement error tables is a virtual object and cannot be modified
ALTER TABLE information_schema.tables RENAME TO information_schema.bad
statement error tables is a virtual object and cannot be modified
ALTER TABLE information_schema.tables RENAME COLUMN x TO y
statement error tables is a virtual object and cannot be modified
ALTER TABLE information_schema.tables ADD COLUMN x DECIMAL
statement error tables is a virtual object and cannot be modified
ALTER TABLE information_schema.tables DROP COLUMN x
statement error tables is a virtual object and cannot be modified
ALTER TABLE information_schema.tables ADD CONSTRAINT foo UNIQUE (b)
statement error tables is a virtual object and cannot be modified
ALTER TABLE information_schema.tables DROP CONSTRAINT bar
statement error tables is a virtual object and cannot be modified
ALTER TABLE information_schema.tables ALTER COLUMN x SET DEFAULT 'foo'
statement error tables is a virtual object and cannot be modified
ALTER TABLE information_schema.tables ALTER x DROP NOT NULL
statement error collation_character_set_applicability is a virtual object and cannot be modified
ALTER TABLE information_schema.collation_character_set_applicability ALTER x DROP NOT NULL
statement error collations is a virtual object and cannot be modified
ALTER TABLE information_schema.collations ALTER x DROP NOT NULL
statement error tables is a virtual object and cannot be modified
CREATE INDEX i on information_schema.tables (x)
statement error tables is a virtual object and cannot be modified
DROP TABLE information_schema.tables
statement error tables is a virtual object and cannot be modified
DROP INDEX information_schema.tables@i
statement error session_variables is a virtual object and cannot be modified
ALTER TABLE information_schema.session_variables ALTER x DROP NOT NULL
# Verify information_schema tables handles read-only property correctly.
query error user root does not have DELETE privilege on relation tables
DELETE FROM information_schema.tables
query error user root does not have INSERT privilege on relation tables
INSERT INTO information_schema.tables VALUES ('abc')
statement error user root does not have UPDATE privilege on relation tables
UPDATE information_schema.tables SET a = 'abc'
statement error tables is a virtual object and cannot be modified
TRUNCATE TABLE information_schema.tables
# Verify information_schema collation_character_set_applicability handles read-only property correctly.
query error user root does not have DELETE privilege on relation collation_character_set_applicability
DELETE FROM information_schema.collation_character_set_applicability
query error user root does not have INSERT privilege on relation collation_character_set_applicability
INSERT INTO information_schema.collation_character_set_applicability VALUES ('abc')
statement error user root does not have UPDATE privilege on relation collation_character_set_applicability
UPDATE information_schema.collation_character_set_applicability SET a = 'abc'
statement error collation_character_set_applicability is a virtual object and cannot be modified
TRUNCATE TABLE information_schema.collation_character_set_applicability
# Verify information_schema collations handles read-only property correctly.
query error user root does not have DELETE privilege on relation collations
DELETE FROM information_schema.collations
query error user root does not have INSERT privilege on relation collations
INSERT INTO information_schema.collations VALUES ('abc')
statement error user root does not have UPDATE privilege on relation collations
UPDATE information_schema.collations SET a = 'abc'
statement error collations is a virtual object and cannot be modified
TRUNCATE TABLE information_schema.collations
# Verify information_schema session_variables handles read-only property correctly.
query error user root does not have DELETE privilege on relation session_variables
DELETE FROM information_schema.session_variables
query error user root does not have INSERT privilege on relation session_variables
INSERT INTO information_schema.session_variables VALUES ('abc')
statement error user root does not have UPDATE privilege on relation session_variables
UPDATE information_schema.session_variables SET a = 'abc'
statement error session_variables is a virtual object and cannot be modified
TRUNCATE TABLE information_schema.session_variables
# Verify information_schema handles reflection correctly.
query TTTTTT
SHOW DATABASES
----
defaultdb root NULL NULL {} NULL
postgres root NULL NULL {} NULL
system node NULL NULL {} NULL
test root NULL NULL {} NULL
query TTTTIT
SHOW TABLES FROM test.information_schema
----
information_schema administrable_role_authorizations table admin NULL NULL
information_schema applicable_roles table admin NULL NULL
information_schema attributes table admin NULL NULL
information_schema character_sets table admin NULL NULL
information_schema check_constraint_routine_usage table admin NULL NULL
information_schema check_constraints table admin NULL NULL
information_schema collation_character_set_applicability table admin NULL NULL
information_schema collations table admin NULL NULL
information_schema column_column_usage table admin NULL NULL
information_schema column_domain_usage table admin NULL NULL
information_schema column_options table admin NULL NULL
information_schema column_privileges table admin NULL NULL
information_schema column_statistics table admin NULL NULL
information_schema column_udt_usage table admin NULL NULL
information_schema columns table admin NULL NULL
information_schema columns_extensions table admin NULL NULL
information_schema constraint_column_usage table admin NULL NULL
information_schema constraint_table_usage table admin NULL NULL
information_schema data_type_privileges table admin NULL NULL
information_schema domain_constraints table admin NULL NULL
information_schema domain_udt_usage table admin NULL NULL
information_schema domains table admin NULL NULL
information_schema element_types table admin NULL NULL
information_schema enabled_roles table admin NULL NULL
information_schema engines table admin NULL NULL
information_schema events table admin NULL NULL
information_schema files table admin NULL NULL
information_schema foreign_data_wrapper_options table admin NULL NULL
information_schema foreign_data_wrappers table admin NULL NULL
information_schema foreign_server_options table admin NULL NULL
information_schema foreign_servers table admin NULL NULL
information_schema foreign_table_options table admin NULL NULL
information_schema foreign_tables table admin NULL NULL
information_schema information_schema_catalog_name table admin NULL NULL
information_schema key_column_usage table admin NULL NULL
information_schema keywords table admin NULL NULL
information_schema optimizer_trace table admin NULL NULL
information_schema parameters table admin NULL NULL
information_schema partitions table admin NULL NULL
information_schema plugins table admin NULL NULL
information_schema processlist table admin NULL NULL
information_schema profiling table admin NULL NULL
information_schema referential_constraints table admin NULL NULL
information_schema resource_groups table admin NULL NULL
information_schema role_column_grants table admin NULL NULL
information_schema role_routine_grants table admin NULL NULL
information_schema role_table_grants table admin NULL NULL
information_schema role_udt_grants table admin NULL NULL
information_schema role_usage_grants table admin NULL NULL
information_schema routine_privileges table admin NULL NULL
information_schema routines table admin NULL NULL
information_schema schema_privileges table admin NULL NULL
information_schema schemata table admin NULL NULL
information_schema schemata_extensions table admin NULL NULL
information_schema sequences table admin NULL NULL
information_schema session_variables table admin NULL NULL
information_schema sql_features table admin NULL NULL
information_schema sql_implementation_info table admin NULL NULL
information_schema sql_parts table admin NULL NULL
information_schema sql_sizing table admin NULL NULL
information_schema st_geometry_columns table admin NULL NULL
information_schema st_spatial_reference_systems table admin NULL NULL
information_schema st_units_of_measure table admin NULL NULL
information_schema statistics table admin NULL NULL
information_schema table_constraints table admin NULL NULL
information_schema table_constraints_extensions table admin NULL NULL
information_schema table_privileges table admin NULL NULL
information_schema tables table admin NULL NULL
information_schema tables_extensions table admin NULL NULL
information_schema tablespaces table admin NULL NULL
information_schema tablespaces_extensions table admin NULL NULL
information_schema transforms table admin NULL NULL
information_schema triggered_update_columns table admin NULL NULL
information_schema triggers table admin NULL NULL
information_schema type_privileges table admin NULL NULL
information_schema udt_privileges table admin NULL NULL
information_schema usage_privileges table admin NULL NULL
information_schema user_attributes table admin NULL NULL
information_schema user_defined_types table admin NULL NULL
information_schema user_mapping_options table admin NULL NULL
information_schema user_mappings table admin NULL NULL
information_schema user_privileges table admin NULL NULL
information_schema view_column_usage table admin NULL NULL
information_schema view_routine_usage table admin NULL NULL
information_schema view_table_usage table admin NULL NULL
information_schema views table admin NULL NULL
query TT colnames
SHOW CREATE TABLE information_schema.tables
----
table_name create_statement
information_schema.tables CREATE TABLE information_schema.tables (
table_catalog STRING NOT NULL,
table_schema STRING NOT NULL,
table_name STRING NOT NULL,
table_type STRING NOT NULL,
is_insertable_into STRING NOT NULL,
version INT8 NULL
)
query TTBTTTB colnames
SHOW COLUMNS FROM information_schema.tables
----
column_name data_type is_nullable column_default generation_expression indices is_hidden
table_catalog STRING false NULL · {} false
table_schema STRING false NULL · {} false
table_name STRING false NULL · {} false
table_type STRING false NULL · {} false
is_insertable_into STRING false NULL · {} false
version INT8 true NULL · {} false
query TTBITTBBB colnames
SHOW INDEXES FROM information_schema.tables
----
table_name index_name non_unique seq_in_index column_name direction storing implicit visible
query TTTTB colnames
SHOW CONSTRAINTS FROM information_schema.tables
----
table_name constraint_name constraint_type details validated
query TTTTTB colnames
SHOW GRANTS ON information_schema.tables
----
database_name schema_name table_name grantee privilege_type is_grantable
test information_schema tables public SELECT false
# Verify selecting from information_schema.
## information_schema.schemata
query TTTTT colnames
SELECT * FROM information_schema.schemata
----
catalog_name schema_name default_character_set_name sql_path crdb_is_user_defined
test crdb_internal NULL NULL NO
test information_schema NULL NULL NO
test pg_catalog NULL NULL NO
test pg_extension NULL NULL NO
test public NULL NULL YES
query TTTTT colnames
SELECT * FROM INFormaTION_SCHEMa.schemata
----
catalog_name schema_name default_character_set_name sql_path crdb_is_user_defined
test crdb_internal NULL NULL NO
test information_schema NULL NULL NO
test pg_catalog NULL NULL NO
test pg_extension NULL NULL NO
test public NULL NULL YES
## information_schema.tables
# Check the default contents of information_schema.tables (incl. the
# special system tables)
query TT rowsort
select table_schema, table_name FROM information_schema.tables
----
crdb_internal active_range_feeds
crdb_internal backward_dependencies
crdb_internal builtin_functions
crdb_internal cluster_contended_indexes
crdb_internal cluster_contended_keys
crdb_internal cluster_contended_tables
crdb_internal cluster_contention_events
crdb_internal cluster_database_privileges
crdb_internal cluster_distsql_flows
crdb_internal cluster_execution_insights
crdb_internal cluster_inflight_traces
crdb_internal cluster_locks
crdb_internal cluster_queries
crdb_internal cluster_sessions
crdb_internal cluster_settings
crdb_internal cluster_statement_statistics
crdb_internal cluster_transaction_statistics
crdb_internal cluster_transactions
crdb_internal create_function_statements
crdb_internal create_schema_statements
crdb_internal create_statements
crdb_internal create_type_statements
crdb_internal cross_db_references
crdb_internal databases
crdb_internal default_privileges
crdb_internal feature_usage
crdb_internal forward_dependencies
crdb_internal gossip_alerts
crdb_internal gossip_liveness
crdb_internal gossip_network
crdb_internal gossip_nodes
crdb_internal index_columns
crdb_internal index_usage_statistics
crdb_internal invalid_objects
crdb_internal jobs
crdb_internal kv_catalog_comments
crdb_internal kv_catalog_descriptor
crdb_internal kv_catalog_namespace
crdb_internal kv_catalog_zones
crdb_internal kv_node_liveness
crdb_internal kv_node_status
crdb_internal kv_store_status
crdb_internal leases
crdb_internal lost_descriptors_with_data
crdb_internal node_build_info
crdb_internal node_contention_events
crdb_internal node_distsql_flows
crdb_internal node_execution_insights
crdb_internal node_inflight_trace_spans
crdb_internal node_metrics
crdb_internal node_queries
crdb_internal node_runtime_info
crdb_internal node_sessions
crdb_internal node_statement_statistics
crdb_internal node_transaction_statistics
crdb_internal node_transactions
crdb_internal node_txn_stats
crdb_internal partitions
crdb_internal pg_catalog_table_is_implemented
crdb_internal ranges
crdb_internal ranges_no_leases
crdb_internal regions
crdb_internal schema_changes
crdb_internal session_trace
crdb_internal session_variables
crdb_internal statement_statistics
crdb_internal super_regions
crdb_internal table_columns
crdb_internal table_indexes
crdb_internal table_row_statistics
crdb_internal tables
crdb_internal tenant_usage_details
crdb_internal transaction_contention_events
crdb_internal transaction_statistics
crdb_internal zones
information_schema administrable_role_authorizations
information_schema applicable_roles
information_schema attributes
information_schema character_sets
information_schema check_constraint_routine_usage
information_schema check_constraints
information_schema collation_character_set_applicability
information_schema collations
information_schema column_column_usage
information_schema column_domain_usage
information_schema column_options
information_schema column_privileges
information_schema column_statistics
information_schema column_udt_usage
information_schema columns
information_schema columns_extensions
information_schema constraint_column_usage
information_schema constraint_table_usage
information_schema data_type_privileges
information_schema domain_constraints
information_schema domain_udt_usage
information_schema domains
information_schema element_types
information_schema enabled_roles
information_schema engines
information_schema events
information_schema files
information_schema foreign_data_wrapper_options
information_schema foreign_data_wrappers
information_schema foreign_server_options
information_schema foreign_servers
information_schema foreign_table_options
information_schema foreign_tables
information_schema information_schema_catalog_name
information_schema key_column_usage
information_schema keywords
information_schema optimizer_trace
information_schema parameters
information_schema partitions
information_schema plugins
information_schema processlist
information_schema profiling
information_schema referential_constraints
information_schema resource_groups
information_schema role_column_grants
information_schema role_routine_grants
information_schema role_table_grants
information_schema role_udt_grants
information_schema role_usage_grants
information_schema routine_privileges
information_schema routines
information_schema schema_privileges
information_schema schemata
information_schema schemata_extensions
information_schema sequences
information_schema session_variables
information_schema sql_features
information_schema sql_implementation_info
information_schema sql_parts
information_schema sql_sizing
information_schema st_geometry_columns
information_schema st_spatial_reference_systems
information_schema st_units_of_measure
information_schema statistics
information_schema table_constraints
information_schema table_constraints_extensions
information_schema table_privileges
information_schema tables
information_schema tables_extensions
information_schema tablespaces
information_schema tablespaces_extensions
information_schema transforms
information_schema triggered_update_columns
information_schema triggers
information_schema type_privileges
information_schema udt_privileges
information_schema usage_privileges
information_schema user_attributes
information_schema user_defined_types
information_schema user_mapping_options
information_schema user_mappings
information_schema user_privileges
information_schema view_column_usage
information_schema view_routine_usage
information_schema view_table_usage
information_schema views
pg_catalog pg_aggregate
pg_catalog pg_am
pg_catalog pg_amop
pg_catalog pg_amproc
pg_catalog pg_attrdef
pg_catalog pg_attribute
pg_catalog pg_auth_members
pg_catalog pg_authid
pg_catalog pg_available_extension_versions
pg_catalog pg_available_extensions
pg_catalog pg_cast
pg_catalog pg_class
pg_catalog pg_collation
pg_catalog pg_config
pg_catalog pg_constraint
pg_catalog pg_conversion
pg_catalog pg_cursors
pg_catalog pg_database
pg_catalog pg_db_role_setting
pg_catalog pg_default_acl
pg_catalog pg_depend
pg_catalog pg_description
pg_catalog pg_enum
pg_catalog pg_event_trigger
pg_catalog pg_extension
pg_catalog pg_file_settings
pg_catalog pg_foreign_data_wrapper
pg_catalog pg_foreign_server
pg_catalog pg_foreign_table
pg_catalog pg_group
pg_catalog pg_hba_file_rules
pg_catalog pg_index
pg_catalog pg_indexes
pg_catalog pg_inherits
pg_catalog pg_init_privs
pg_catalog pg_language
pg_catalog pg_largeobject
pg_catalog pg_largeobject_metadata
pg_catalog pg_locks
pg_catalog pg_matviews
pg_catalog pg_namespace
pg_catalog pg_opclass
pg_catalog pg_operator
pg_catalog pg_opfamily
pg_catalog pg_partitioned_table
pg_catalog pg_policies
pg_catalog pg_policy
pg_catalog pg_prepared_statements
pg_catalog pg_prepared_xacts
pg_catalog pg_proc
pg_catalog pg_publication
pg_catalog pg_publication_rel
pg_catalog pg_publication_tables
pg_catalog pg_range
pg_catalog pg_replication_origin
pg_catalog pg_replication_origin_status
pg_catalog pg_replication_slots
pg_catalog pg_rewrite
pg_catalog pg_roles
pg_catalog pg_rules
pg_catalog pg_seclabel
pg_catalog pg_seclabels
pg_catalog pg_sequence
pg_catalog pg_sequences
pg_catalog pg_settings
pg_catalog pg_shadow
pg_catalog pg_shdepend
pg_catalog pg_shdescription
pg_catalog pg_shmem_allocations
pg_catalog pg_shseclabel
pg_catalog pg_stat_activity
pg_catalog pg_stat_all_indexes
pg_catalog pg_stat_all_tables
pg_catalog pg_stat_archiver
pg_catalog pg_stat_bgwriter
pg_catalog pg_stat_database
pg_catalog pg_stat_database_conflicts
pg_catalog pg_stat_gssapi
pg_catalog pg_stat_progress_analyze
pg_catalog pg_stat_progress_basebackup
pg_catalog pg_stat_progress_cluster
pg_catalog pg_stat_progress_create_index
pg_catalog pg_stat_progress_vacuum
pg_catalog pg_stat_replication
pg_catalog pg_stat_slru
pg_catalog pg_stat_ssl
pg_catalog pg_stat_subscription
pg_catalog pg_stat_sys_indexes
pg_catalog pg_stat_sys_tables
pg_catalog pg_stat_user_functions
pg_catalog pg_stat_user_indexes
pg_catalog pg_stat_user_tables
pg_catalog pg_stat_wal_receiver
pg_catalog pg_stat_xact_all_tables
pg_catalog pg_stat_xact_sys_tables
pg_catalog pg_stat_xact_user_functions
pg_catalog pg_stat_xact_user_tables
pg_catalog pg_statio_all_indexes
pg_catalog pg_statio_all_sequences
pg_catalog pg_statio_all_tables
pg_catalog pg_statio_sys_indexes
pg_catalog pg_statio_sys_sequences
pg_catalog pg_statio_sys_tables
pg_catalog pg_statio_user_indexes
pg_catalog pg_statio_user_sequences
pg_catalog pg_statio_user_tables
pg_catalog pg_statistic
pg_catalog pg_statistic_ext
pg_catalog pg_statistic_ext_data
pg_catalog pg_stats
pg_catalog pg_stats_ext
pg_catalog pg_subscription
pg_catalog pg_subscription_rel
pg_catalog pg_tables
pg_catalog pg_tablespace
pg_catalog pg_timezone_abbrevs
pg_catalog pg_timezone_names
pg_catalog pg_transform
pg_catalog pg_trigger
pg_catalog pg_ts_config
pg_catalog pg_ts_config_map
pg_catalog pg_ts_dict
pg_catalog pg_ts_parser
pg_catalog pg_ts_template
pg_catalog pg_type
pg_catalog pg_user
pg_catalog pg_user_mapping
pg_catalog pg_user_mappings
pg_catalog pg_views
pg_extension geography_columns
pg_extension geometry_columns
pg_extension spatial_ref_sys
statement ok
CREATE DATABASE other_db
statement ok
CREATE TABLE other_db.xyz (i INT)
statement ok
CREATE SEQUENCE other_db.seq
statement ok
CREATE VIEW other_db.abc AS SELECT i from other_db.xyz
statement ok
GRANT UPDATE ON other_db.xyz TO testuser
user testuser
# Check the output with the current database set to 'test' (the
# defaults in tests). This will make the tables in other_db invisible to
# a non-root user.
query T
SELECT table_name FROM information_schema.tables WHERE table_catalog = 'other_db'
----
# Check that the other_db tables become visible when a prefix is specified
query T
SELECT table_name FROM other_db.information_schema.tables WHERE table_catalog = 'other_db' AND table_schema = 'public'
----
xyz
abc
# Check that one can see all tables with the empty prefix.
query T rowsort
SELECT table_name FROM "".information_schema.tables WHERE table_catalog = 'other_db'
----
active_range_feeds
backward_dependencies
builtin_functions
cluster_contended_indexes
cluster_contended_keys
cluster_contended_tables
cluster_contention_events
cluster_database_privileges
cluster_distsql_flows
cluster_execution_insights
cluster_inflight_traces
cluster_locks
cluster_queries
cluster_sessions
cluster_settings
cluster_statement_statistics
cluster_transaction_statistics
cluster_transactions
create_function_statements
create_schema_statements
create_statements
create_type_statements
cross_db_references
databases
default_privileges
feature_usage
forward_dependencies
gossip_alerts
gossip_liveness
gossip_network
gossip_nodes
index_columns
index_usage_statistics
invalid_objects
jobs
kv_catalog_comments
kv_catalog_descriptor
kv_catalog_namespace
kv_catalog_zones
kv_node_liveness
kv_node_status
kv_store_status
leases
lost_descriptors_with_data
node_build_info
node_contention_events
node_distsql_flows
node_execution_insights
node_inflight_trace_spans
node_metrics
node_queries
node_runtime_info
node_sessions
node_statement_statistics
node_transaction_statistics
node_transactions
node_txn_stats
partitions
pg_catalog_table_is_implemented
ranges
ranges_no_leases
regions
schema_changes
session_trace
session_variables
statement_statistics
super_regions
table_columns
table_indexes
table_row_statistics
tables
tenant_usage_details
transaction_contention_events
transaction_statistics
zones
administrable_role_authorizations
applicable_roles
attributes
character_sets
check_constraint_routine_usage
check_constraints
collation_character_set_applicability
collations
column_column_usage
column_domain_usage
column_options
column_privileges
column_statistics
column_udt_usage
columns
columns_extensions
constraint_column_usage
constraint_table_usage
data_type_privileges
domain_constraints
domain_udt_usage
domains
element_types
enabled_roles
engines
events
files
foreign_data_wrapper_options
foreign_data_wrappers
foreign_server_options
foreign_servers
foreign_table_options
foreign_tables
information_schema_catalog_name
key_column_usage
keywords
optimizer_trace
parameters
partitions
plugins
processlist
profiling
referential_constraints
resource_groups
role_column_grants
role_routine_grants
role_table_grants
role_udt_grants
role_usage_grants
routine_privileges
routines
schema_privileges
schemata
schemata_extensions
sequences
session_variables
sql_features
sql_implementation_info
sql_parts
sql_sizing
st_geometry_columns
st_spatial_reference_systems
st_units_of_measure
statistics
table_constraints
table_constraints_extensions
table_privileges
tables
tables_extensions
tablespaces
tablespaces_extensions
transforms
triggered_update_columns
triggers
type_privileges
udt_privileges
usage_privileges
user_attributes
user_defined_types
user_mapping_options
user_mappings
user_privileges
view_column_usage
view_routine_usage
view_table_usage
views
pg_aggregate
pg_am
pg_amop
pg_amproc
pg_attrdef
pg_attribute
pg_auth_members
pg_authid
pg_available_extension_versions
pg_available_extensions
pg_cast
pg_class
pg_collation
pg_config
pg_constraint
pg_conversion
pg_cursors
pg_database
pg_db_role_setting
pg_default_acl
pg_depend
pg_description
pg_enum
pg_event_trigger
pg_extension
pg_file_settings
pg_foreign_data_wrapper
pg_foreign_server
pg_foreign_table
pg_group
pg_hba_file_rules
pg_index
pg_indexes
pg_inherits
pg_init_privs
pg_language
pg_largeobject
pg_largeobject_metadata
pg_locks
pg_matviews
pg_namespace
pg_opclass
pg_operator
pg_opfamily
pg_partitioned_table
pg_policies
pg_policy
pg_prepared_statements
pg_prepared_xacts
pg_proc
pg_publication
pg_publication_rel
pg_publication_tables
pg_range
pg_replication_origin
pg_replication_origin_status
pg_replication_slots
pg_rewrite
pg_roles
pg_rules
pg_seclabel
pg_seclabels
pg_sequence
pg_sequences
pg_settings
pg_shadow
pg_shdepend
pg_shdescription
pg_shmem_allocations
pg_shseclabel
pg_stat_activity
pg_stat_all_indexes
pg_stat_all_tables
pg_stat_archiver
pg_stat_bgwriter
pg_stat_database
pg_stat_database_conflicts
pg_stat_gssapi
pg_stat_progress_analyze
pg_stat_progress_basebackup
pg_stat_progress_cluster
pg_stat_progress_create_index
pg_stat_progress_vacuum
pg_stat_replication
pg_stat_slru
pg_stat_ssl
pg_stat_subscription
pg_stat_sys_indexes
pg_stat_sys_tables
pg_stat_user_functions
pg_stat_user_indexes
pg_stat_user_tables
pg_stat_wal_receiver
pg_stat_xact_all_tables
pg_stat_xact_sys_tables
pg_stat_xact_user_functions
pg_stat_xact_user_tables
pg_statio_all_indexes
pg_statio_all_sequences
pg_statio_all_tables
pg_statio_sys_indexes
pg_statio_sys_sequences
pg_statio_sys_tables
pg_statio_user_indexes
pg_statio_user_sequences
pg_statio_user_tables
pg_statistic
pg_statistic_ext
pg_statistic_ext_data
pg_stats
pg_stats_ext
pg_subscription
pg_subscription_rel
pg_tables
pg_tablespace
pg_timezone_abbrevs