catalog.td 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. $ set-arg-default replicas=1
  10. $ set-arg-default single-replica-cluster=quickstart
  11. # Testdrive accounts for multi-replica runs by creating additional clusters,
  12. # which affect the output of this test––instead just don't run this test.
  13. $ skip-if
  14. SELECT ${arg.replicas} > 1;
  15. $ set-sql-timeout duration=1s
  16. # Test \d <object> command
  17. > CREATE TABLE tbl (a int, b text)
  18. > CREATE INDEX tbl_ind ON tbl (b)
  19. > CREATE INDEX tbl_lower_ind ON tbl (lower(b), a)
  20. $ psql-execute command="\d tbl"
  21. \ Table "public.tbl"
  22. Column | Type | Collation | Nullable | Default
  23. --------+---------+-----------+----------+---------
  24. a | integer | | | NULL
  25. b | text | | | NULL
  26. Indexes:
  27. "tbl_ind" arrangement (b)
  28. "tbl_lower_ind" arrangement (pg_catalog.lower(b),a)
  29. > DROP TABLE tbl CASCADE
  30. # What schemas do we have by default?
  31. > SHOW SCHEMAS FROM materialize
  32. public ""
  33. information_schema ""
  34. mz_catalog ""
  35. mz_catalog_unstable ""
  36. mz_unsafe ""
  37. mz_internal ""
  38. mz_introspection ""
  39. pg_catalog ""
  40. > SHOW SCHEMAS
  41. name comment
  42. ------------------
  43. information_schema ""
  44. public ""
  45. mz_catalog ""
  46. mz_catalog_unstable ""
  47. mz_unsafe ""
  48. mz_internal ""
  49. mz_introspection ""
  50. pg_catalog ""
  51. $ psql-execute command=\dn
  52. \ List of schemas
  53. Name | Owner
  54. ---------------------+-----------
  55. mz_catalog | mz_system
  56. mz_catalog_unstable | mz_system
  57. mz_internal | mz_system
  58. mz_introspection | mz_system
  59. mz_unsafe | mz_system
  60. public | mz_system
  61. $ psql-execute command="\dn mz_catalog"
  62. \ List of schemas
  63. Name | Owner
  64. ------------+-----------
  65. mz_catalog | mz_system
  66. $ psql-execute command="\dn mz_*"
  67. \ List of schemas
  68. Name | Owner
  69. ---------------------+-----------
  70. mz_catalog | mz_system
  71. mz_catalog_unstable | mz_system
  72. mz_internal | mz_system
  73. mz_introspection | mz_system
  74. mz_unsafe | mz_system
  75. # What objects do we have by default?
  76. > SHOW OBJECTS
  77. name type comment
  78. -----------------------
  79. # Creating a schema should be reflected in the output of SHOW SCHEMAS.
  80. > CREATE SCHEMA s
  81. > SHOW SCHEMAS
  82. name comment
  83. -----------------------
  84. public ""
  85. s ""
  86. information_schema ""
  87. mz_catalog ""
  88. mz_catalog_unstable ""
  89. mz_internal ""
  90. mz_introspection ""
  91. mz_unsafe ""
  92. pg_catalog ""
  93. # Creating a schema with a name that already exists should fail.
  94. ! CREATE SCHEMA s
  95. contains:schema 's' already exists
  96. # Dropping a schema with a view should only succeed with CASCADE.
  97. > CREATE VIEW s.v AS SELECT 1
  98. ! DROP SCHEMA s
  99. contains:schema 'materialize.s' cannot be dropped without CASCADE while it contains objects
  100. > DROP SCHEMA s CASCADE
  101. # Dropping a schema with no objects should succeed without CASCADE.
  102. > CREATE SCHEMA s
  103. > CREATE VIEW s.v AS SELECT 1
  104. > DROP VIEW s.v
  105. > DROP SCHEMA s
  106. # What databases do we have by default?
  107. > SHOW DATABASES
  108. name comment
  109. ------------
  110. materialize ""
  111. > SELECT name FROM mz_databases
  112. name
  113. -----------
  114. materialize
  115. # Creating a database should be reflected in the output of SHOW DATABASES.
  116. > CREATE DATABASE d
  117. > SHOW DATABASES
  118. name comment
  119. -----------
  120. d ""
  121. materialize ""
  122. # ...and also in `\l`
  123. $ psql-execute command="\l"
  124. \ List of databases
  125. Name | Owner | Encoding | Locale Provider | Collate | Ctype | ICU Locale | ICU Rules | Access privileges
  126. -------------+-------------+----------+-----------------+---------+-------+------------+-----------+-------------------
  127. d | materialize | UTF8 | libc | C | C | | |
  128. materialize | mz_system | UTF8 | libc | C | C | | |
  129. > SELECT name FROM mz_databases
  130. name
  131. -----------
  132. materialize
  133. d
  134. # The same catalog information should be accessible with any amount of
  135. # database or schema qualification.
  136. > SELECT count(*) FROM materialize.mz_catalog.mz_databases
  137. 2
  138. > SELECT count(*) FROM d.mz_catalog.mz_databases
  139. 2
  140. # SHOW DATABASES should filter its output according to the provided LIKE or
  141. # WHERE clause.
  142. > SHOW DATABASES LIKE 'foo'
  143. > SHOW DATABASES LIKE 'd'
  144. d ""
  145. > SHOW DATABASES LIKE 'mat%'
  146. materialize ""
  147. > SHOW DATABASES WHERE (SELECT name = name)
  148. materialize ""
  149. d ""
  150. > SHOW DATABASES WHERE (name = (SELECT min(name) FROM mz_databases))
  151. d ""
  152. ! SHOW DATABASES WHERE 7
  153. contains:WHERE clause must have type boolean, not type integer
  154. # Creating a database with a name that already exists should fail.
  155. ! CREATE DATABASE d
  156. contains:database 'd' already exists
  157. # The new database should have a default public schema.
  158. > SHOW SCHEMAS FROM d
  159. name comment
  160. ---------------------------
  161. public ""
  162. information_schema ""
  163. mz_catalog ""
  164. mz_catalog_unstable ""
  165. mz_internal ""
  166. mz_introspection ""
  167. mz_unsafe ""
  168. pg_catalog ""
  169. # New schemas in the database should appear in the output of SHOW SCHEMAS FROM.
  170. > CREATE SCHEMA d.s
  171. > SHOW SCHEMAS FROM d
  172. name comment
  173. -------------------
  174. public ""
  175. s ""
  176. information_schema ""
  177. mz_catalog ""
  178. mz_catalog_unstable ""
  179. mz_internal ""
  180. mz_introspection ""
  181. mz_unsafe ""
  182. pg_catalog ""
  183. # SHOW SCHEMAS should filter its output based on the provided LIKE or WHERE
  184. # clause.
  185. > SHOW SCHEMAS LIKE 'pub%'
  186. public ""
  187. > SHOW SCHEMAS LIKE 'private'
  188. > SHOW SCHEMAS WHERE name = 'public'
  189. public ""
  190. # New views in the database should work.
  191. > CREATE VIEW d.public.v1 AS SELECT 1
  192. > SHOW VIEWS FROM d.public
  193. name comment
  194. ---------------
  195. v1 ""
  196. # Setting the session database should update name resolution appropriately.
  197. > SET DATABASE = d
  198. > SHOW DATABASE
  199. d
  200. > SHOW SCHEMAS
  201. public ""
  202. s ""
  203. information_schema ""
  204. mz_catalog ""
  205. mz_catalog_unstable ""
  206. mz_internal ""
  207. mz_introspection ""
  208. mz_unsafe ""
  209. pg_catalog ""
  210. > CREATE VIEW v2 AS SELECT 2
  211. > SHOW VIEWS
  212. v1 ""
  213. v2 ""
  214. > SELECT * FROM v1 UNION ALL SELECT * FROM v2
  215. 1
  216. 2
  217. > SHOW OBJECTS
  218. name type comment
  219. -----------------------
  220. v1 view ""
  221. v2 view ""
  222. # Test minimizing name qualification
  223. > CREATE TYPE int_list AS list (ELEMENT TYPE = int4)
  224. > SELECT pg_typeof('{1}'::d.public.int_list)
  225. int_list
  226. > CREATE SCHEMA other
  227. > CREATE TYPE other.int_list AS list (ELEMENT TYPE = int4)
  228. > SELECT pg_typeof('{1}'::d.other.int_list)
  229. other.int_list
  230. > CREATE DATABASE foo
  231. > CREATE SCHEMA foo.other
  232. > CREATE TYPE foo.other.int_list AS LIST (ELEMENT TYPE = int4)
  233. > SELECT pg_typeof('{1}'::foo.other.int_list)
  234. foo.other.int_list
  235. > CREATE TYPE bool AS LIST (ELEMENT TYPE = int4)
  236. ! SELECT '{1}'::bool
  237. contains:invalid input syntax for type boolean: "{1}"
  238. > SELECT pg_typeof('{1}'::public.bool);
  239. public.bool
  240. > SELECT pg_typeof('{1}'::d.public.bool);
  241. public.bool
  242. > DROP DATABASE foo
  243. ! DROP OBJECT v1
  244. contains:Expected one of TABLE or VIEW or MATERIALIZED or SOURCE or SINK or INDEX or TYPE or ROLE or USER or CLUSTER or SECRET or CONNECTION or DATABASE or SCHEMA or FUNCTION or CONTINUAL or NETWORK, found identifier
  245. > SHOW OBJECTS
  246. name type comment
  247. -------------------------------
  248. bool type ""
  249. int_list type ""
  250. v1 view ""
  251. v2 view ""
  252. # Create one of every mz_object type
  253. $ set schema={
  254. "name": "row",
  255. "type": "record",
  256. "fields": [
  257. {"name": "a", "type": "long"}
  258. ]
  259. }
  260. $ kafka-create-topic topic=data
  261. $ kafka-ingest format=avro topic=data schema=${schema} timestamp=1
  262. {"a": 1}
  263. > CREATE TABLE tbl (a int, b text);
  264. > CREATE SECRET pass_secret AS 'pass';
  265. > CREATE CONNECTION IF NOT EXISTS csr_conn TO CONFLUENT SCHEMA REGISTRY (
  266. URL '${testdrive.schema-registry-url}'
  267. );
  268. > CREATE MATERIALIZED VIEW mv AS SELECT (1);
  269. > CREATE CONNECTION kafka_conn
  270. TO KAFKA (BROKER '${testdrive.kafka-addr}', SECURITY PROTOCOL PLAINTEXT);
  271. > CREATE SOURCE source_data
  272. IN CLUSTER ${arg.single-replica-cluster}
  273. FROM KAFKA CONNECTION kafka_conn (TOPIC 'testdrive-data-${testdrive.seed}');
  274. > CREATE TABLE source_data_tbl FROM SOURCE source_data (REFERENCE "testdrive-data-${testdrive.seed}")
  275. FORMAT AVRO USING CONFLUENT SCHEMA REGISTRY CONNECTION csr_conn;
  276. > CREATE SINK snk
  277. IN CLUSTER ${arg.single-replica-cluster}
  278. FROM source_data_tbl
  279. INTO KAFKA CONNECTION kafka_conn (TOPIC 'testdrive-catalog-sink-${testdrive.seed}')
  280. FORMAT AVRO USING CONFLUENT SCHEMA REGISTRY CONNECTION csr_conn
  281. ENVELOPE DEBEZIUM;
  282. > SHOW OBJECTS
  283. name type comment
  284. -------------------------------------
  285. bool type ""
  286. csr_conn connection ""
  287. int_list type ""
  288. v1 view ""
  289. v2 view ""
  290. tbl table ""
  291. pass_secret secret ""
  292. kafka_conn connection ""
  293. mv materialized-view ""
  294. source_data source ""
  295. source_data_progress source ""
  296. source_data_tbl table ""
  297. snk sink ""
  298. > SELECT DISTINCT(TYPE) FROM mz_objects
  299. type
  300. ----
  301. table
  302. source
  303. view
  304. materialized-view
  305. sink
  306. index
  307. connection
  308. type
  309. function
  310. secret
  311. > SELECT * FROM (SHOW OBJECTS) ORDER BY name DESC
  312. bool type ""
  313. csr_conn connection ""
  314. int_list type ""
  315. kafka_conn connection ""
  316. mv materialized-view ""
  317. pass_secret secret ""
  318. snk sink ""
  319. source_data source ""
  320. source_data_progress source ""
  321. source_data_tbl table ""
  322. tbl table ""
  323. v1 view ""
  324. v2 view ""
  325. > SELECT create_sql FROM (SHOW CREATE TABLE tbl)
  326. "CREATE TABLE d.public.tbl (a pg_catalog.int4, b pg_catalog.text);"
  327. ! SHOW COLUMNS FROM pass_secret
  328. contains:d.public.pass_secret is a secret and so does not have columns
  329. ! SHOW COLUMNS FROM kafka_conn
  330. contains:d.public.kafka_conn is a connection and so does not have columns
  331. # DROP DATABASE does not support both RESTRICT and CASCADE.
  332. ! DROP DATABASE d RESTRICT CASCADE
  333. contains:Cannot specify both RESTRICT and CASCADE in DROP
  334. ! DROP DATABASE d CASCADE RESTRICT
  335. contains:Cannot specify both CASCADE and RESTRICT in DROP
  336. ! DROP DATABASE d CASCADE CASCADE
  337. contains:Expected end of statement, found CASCADE
  338. ! DROP DATABASE d RESTRICT
  339. contains:database 'd' cannot be dropped with RESTRICT while it contains schemas
  340. # DROP DATABASE should succeed even when there are objects in the database.
  341. > DROP DATABASE d
  342. # SHOW DATABASES should work, even if the current database has been dropped.
  343. > SHOW DATABASES
  344. name comment
  345. -------------------
  346. materialize ""
  347. > SELECT name FROM mz_databases
  348. name
  349. -----------
  350. materialize
  351. # The session database should remain set to the dropped database, but future
  352. # queries that depend on the session database should fail with sensible error
  353. # messages.
  354. > SHOW DATABASE
  355. d
  356. ! SELECT * FROM v
  357. contains:unknown catalog item 'v'
  358. # But queries that do not depend on the session database should work fine.
  359. > CREATE VIEW materialize.public.v AS SELECT 1
  360. > CREATE DATABASE d
  361. # Dropping the public schema is okay, but dropping the catalog schemas is not.
  362. > DROP SCHEMA public
  363. $ postgres-execute connection=postgres://mz_system@${testdrive.materialize-internal-sql-addr}/materialize
  364. ALTER SYSTEM SET enable_rbac_checks TO false
  365. ! DROP SCHEMA mz_catalog
  366. contains:cannot drop schema mz_catalog because it is required by the database system
  367. ! DROP SCHEMA pg_catalog
  368. contains:cannot drop schema pg_catalog because it is required by the database system
  369. $ postgres-execute connection=postgres://mz_system@${testdrive.materialize-internal-sql-addr}/materialize
  370. ALTER SYSTEM SET enable_rbac_checks TO true
  371. # Schema names that start with "mz_" or "pg_" are reserved for future use by the
  372. # system.
  373. ! CREATE SCHEMA mz_foo
  374. contains:unacceptable schema name 'mz_foo'
  375. ! CREATE SCHEMA pg_bar
  376. contains:unacceptable schema name 'pg_bar'
  377. # The search path is configurable.
  378. > SHOW search_path
  379. "public"
  380. > SET search_path = foo
  381. > SET SCHEMA foo
  382. > SET search_path to public
  383. # Creating views in non-existent databases should fail.
  384. ! CREATE VIEW noexist.ignored AS SELECT 1
  385. contains:unknown schema 'noexist'
  386. ! CREATE VIEW materialize.noexist.ignored AS SELECT 1
  387. contains:unknown schema 'noexist'
  388. ! CREATE VIEW noexist.ignored.ignored AS SELECT 1
  389. contains:unknown database 'noexist'
  390. # As should showing views.
  391. ! SHOW VIEWS FROM noexist
  392. contains:unknown schema 'noexist'
  393. ! SHOW VIEWS FROM noexist_db.noexist_schema
  394. contains:unknown database 'noexist_db'
  395. # Dropping database with cross-schema dependencies is ok.
  396. > CREATE DATABASE d1;
  397. > CREATE SCHEMA d1.s1;
  398. > CREATE VIEW d1.s1.t as select 1;
  399. > CREATE VIEW d1.public.tt as select * from d1.s1.t;
  400. > DROP DATABASE d1;
  401. # Dropping database with cross-database dependencies is ok and drops the
  402. # dependent views.
  403. > CREATE DATABASE d1;
  404. > CREATE VIEW d1.public.t as select 1;
  405. > CREATE DATABASE d2;
  406. > CREATE VIEW d2.public.t AS SELECT * FROM d1.public.t;
  407. > DROP DATABASE d1;
  408. > SHOW DATABASES
  409. name comment
  410. -------------------
  411. d ""
  412. d2 ""
  413. materialize ""
  414. > SELECT name FROM mz_databases
  415. name
  416. -----------
  417. materialize
  418. d
  419. d2
  420. > SHOW VIEWS FROM d2.public;
  421. name comment
  422. ---------------
  423. # Check default sources, tables, and views in mz_catalog.
  424. > SHOW SOURCES FROM mz_catalog
  425. name type cluster comment
  426. ---------------------------------------------------------------------
  427. mz_cluster_replica_frontiers source <null> ""
  428. > SHOW TABLES FROM mz_catalog
  429. name comment
  430. --------------------------------------
  431. mz_array_types ""
  432. mz_audit_events ""
  433. mz_aws_privatelink_connections ""
  434. mz_base_types ""
  435. mz_clusters ""
  436. mz_cluster_replicas ""
  437. mz_cluster_replica_sizes ""
  438. mz_columns ""
  439. mz_connections ""
  440. mz_databases ""
  441. mz_default_privileges ""
  442. mz_egress_ips ""
  443. mz_functions ""
  444. mz_index_columns ""
  445. mz_indexes ""
  446. mz_kafka_connections ""
  447. mz_kafka_sinks ""
  448. mz_kafka_sources ""
  449. mz_list_types ""
  450. mz_map_types ""
  451. mz_materialized_views ""
  452. mz_operators ""
  453. mz_pseudo_types ""
  454. mz_roles ""
  455. mz_role_members ""
  456. mz_role_parameters ""
  457. mz_schemas ""
  458. mz_secrets ""
  459. mz_sinks ""
  460. mz_sources ""
  461. mz_ssh_tunnel_connections ""
  462. mz_system_privileges ""
  463. mz_tables ""
  464. mz_types ""
  465. mz_views ""
  466. > SHOW VIEWS FROM mz_catalog
  467. name comment
  468. -----------------------------------
  469. mz_objects ""
  470. mz_relations ""
  471. mz_recent_storage_usage ""
  472. mz_storage_usage ""
  473. mz_timezone_abbreviations ""
  474. mz_timezone_names ""
  475. # Check default sources, tables, and views in mz_catalog_unstable.
  476. > SHOW SOURCES FROM mz_catalog_unstable
  477. > SHOW TABLES FROM mz_catalog_unstable
  478. > SHOW VIEWS FROM mz_catalog_unstable
  479. # Check default sources, tables, and views in mz_internal.
  480. > SHOW SOURCES FROM mz_internal
  481. name type cluster comment
  482. -----------------------------------------------------------------------
  483. mz_aws_privatelink_connection_status_history source <null> ""
  484. mz_cluster_replica_metrics_history source <null> ""
  485. mz_cluster_replica_status_history source <null> ""
  486. mz_compute_dependencies source <null> ""
  487. mz_compute_error_counts_raw_unified source <null> ""
  488. mz_compute_hydration_times source <null> ""
  489. mz_compute_operator_hydration_statuses_per_worker source <null> ""
  490. mz_frontiers source <null> ""
  491. mz_materialized_view_refreshes source <null> ""
  492. mz_prepared_statement_history source <null> ""
  493. mz_session_history source <null> ""
  494. mz_sink_statistics_raw source <null> ""
  495. mz_sink_status_history source <null> ""
  496. mz_source_statistics_raw source <null> ""
  497. mz_source_status_history source <null> ""
  498. mz_sql_text source <null> ""
  499. mz_statement_execution_history source <null> ""
  500. mz_statement_lifecycle_history source <null> ""
  501. mz_storage_shards source <null> ""
  502. mz_wallclock_global_lag_histogram_raw source <null> ""
  503. mz_wallclock_lag_history source <null> ""
  504. > SHOW TABLES FROM mz_internal
  505. name comment
  506. ------------------------------------------------
  507. mz_aggregates ""
  508. mz_aws_connections ""
  509. mz_cluster_schedules ""
  510. mz_cluster_workload_classes ""
  511. mz_comments ""
  512. mz_continual_tasks ""
  513. mz_history_retention_strategies ""
  514. mz_internal_cluster_replicas ""
  515. mz_pending_cluster_replicas ""
  516. mz_kafka_source_tables ""
  517. mz_license_keys ""
  518. mz_materialized_view_refresh_strategies ""
  519. mz_mysql_source_tables ""
  520. mz_network_policies ""
  521. mz_network_policy_rules ""
  522. mz_object_dependencies ""
  523. mz_optimizer_notices ""
  524. mz_postgres_sources ""
  525. mz_postgres_source_tables ""
  526. mz_sessions ""
  527. mz_source_references ""
  528. mz_sql_server_source_tables ""
  529. mz_storage_usage_by_shard ""
  530. mz_subscriptions ""
  531. mz_type_pg_metadata ""
  532. mz_webhook_sources ""
  533. > SHOW VIEWS FROM mz_internal
  534. name comment
  535. ------------------------------------------------
  536. mz_activity_log_thinned ""
  537. mz_cluster_deployment_lineage ""
  538. mz_cluster_replica_history ""
  539. mz_cluster_replica_metrics ""
  540. mz_cluster_replica_name_history ""
  541. mz_cluster_replica_statuses ""
  542. mz_cluster_replica_utilization ""
  543. mz_cluster_replica_utilization_history ""
  544. mz_compute_hydration_statuses ""
  545. mz_compute_operator_hydration_statuses ""
  546. mz_console_cluster_utilization_overview ""
  547. mz_show_continual_tasks ""
  548. mz_global_frontiers ""
  549. mz_hydration_statuses ""
  550. mz_index_advice ""
  551. mz_materialization_dependencies ""
  552. mz_materialization_lag ""
  553. mz_notices ""
  554. mz_notices_redacted ""
  555. mz_object_fully_qualified_names ""
  556. mz_object_history ""
  557. mz_object_lifetimes ""
  558. mz_object_oid_alias ""
  559. mz_object_transitive_dependencies ""
  560. mz_objects_id_namespace_types ""
  561. mz_recent_activity_log ""
  562. mz_recent_activity_log_thinned ""
  563. mz_recent_activity_log_redacted ""
  564. mz_recent_sql_text ""
  565. mz_recent_sql_text_redacted ""
  566. mz_show_all_my_privileges ""
  567. mz_show_all_objects ""
  568. mz_show_all_privileges ""
  569. mz_show_cluster_privileges ""
  570. mz_show_cluster_replicas ""
  571. mz_show_clusters ""
  572. mz_show_columns ""
  573. mz_show_connections ""
  574. mz_show_database_privileges ""
  575. mz_show_databases ""
  576. mz_show_default_privileges ""
  577. mz_show_indexes ""
  578. mz_show_materialized_views ""
  579. mz_show_my_cluster_privileges ""
  580. mz_show_my_database_privileges ""
  581. mz_show_my_default_privileges ""
  582. mz_show_my_object_privileges ""
  583. mz_show_my_role_members ""
  584. mz_show_my_schema_privileges ""
  585. mz_show_my_system_privileges ""
  586. mz_show_network_policies ""
  587. mz_show_object_privileges ""
  588. mz_show_role_members ""
  589. mz_show_roles ""
  590. mz_show_schema_privileges ""
  591. mz_show_schemas ""
  592. mz_show_secrets ""
  593. mz_show_sinks ""
  594. mz_show_sources ""
  595. mz_show_system_privileges ""
  596. mz_show_tables ""
  597. mz_show_types ""
  598. mz_show_views ""
  599. mz_sink_statistics ""
  600. mz_sink_statuses ""
  601. mz_source_statistics ""
  602. mz_source_statistics_with_history ""
  603. mz_source_statuses ""
  604. mz_sql_text_redacted ""
  605. mz_aws_privatelink_connection_statuses ""
  606. mz_statement_execution_history_redacted ""
  607. mz_wallclock_global_lag ""
  608. mz_wallclock_global_lag_histogram ""
  609. mz_wallclock_global_lag_history ""
  610. mz_wallclock_global_lag_recent_history ""
  611. pg_class_all_databases ""
  612. pg_type_all_databases ""
  613. pg_namespace_all_databases ""
  614. pg_description_all_databases ""
  615. pg_attrdef_all_databases ""
  616. pg_attribute_all_databases ""
  617. # Check default sources, tables, and views in mz_introspection.
  618. > SHOW SOURCES FROM mz_introspection
  619. mz_active_peeks_per_worker log <null> ""
  620. mz_arrangement_batcher_allocations_raw log <null> ""
  621. mz_arrangement_batcher_capacity_raw log <null> ""
  622. mz_arrangement_batcher_records_raw log <null> ""
  623. mz_arrangement_batcher_size_raw log <null> ""
  624. mz_arrangement_batches_raw log <null> ""
  625. mz_arrangement_heap_allocations_raw log <null> ""
  626. mz_arrangement_heap_capacity_raw log <null> ""
  627. mz_arrangement_heap_size_raw log <null> ""
  628. mz_arrangement_records_raw log <null> ""
  629. mz_arrangement_sharing_raw log <null> ""
  630. mz_compute_dataflow_global_ids_per_worker log <null> ""
  631. mz_compute_error_counts_raw log <null> ""
  632. mz_compute_exports_per_worker log <null> ""
  633. mz_compute_frontiers_per_worker log <null> ""
  634. mz_compute_hydration_times_per_worker log <null> ""
  635. mz_compute_import_frontiers_per_worker log <null> ""
  636. mz_compute_lir_mapping_per_worker log <null> ""
  637. mz_compute_operator_durations_histogram_raw log <null> ""
  638. mz_dataflow_addresses_per_worker log <null> ""
  639. mz_dataflow_channels_per_worker log <null> ""
  640. mz_dataflow_operator_reachability_raw log <null> ""
  641. mz_dataflow_operators_per_worker log <null> ""
  642. mz_dataflow_shutdown_durations_histogram_raw log <null> ""
  643. mz_message_counts_received_raw log <null> ""
  644. mz_message_counts_sent_raw log <null> ""
  645. mz_message_batch_counts_received_raw log <null> ""
  646. mz_message_batch_counts_sent_raw log <null> ""
  647. mz_peek_durations_histogram_raw log <null> ""
  648. mz_scheduling_elapsed_raw log <null> ""
  649. mz_scheduling_parks_histogram_raw log <null> ""
  650. > SHOW TABLES FROM mz_introspection
  651. > SHOW VIEWS FROM mz_introspection
  652. mz_active_peeks ""
  653. mz_arrangement_sharing ""
  654. mz_arrangement_sharing_per_worker ""
  655. mz_arrangement_sizes ""
  656. mz_arrangement_sizes_per_worker ""
  657. mz_compute_error_counts ""
  658. mz_compute_error_counts_per_worker ""
  659. mz_compute_exports ""
  660. mz_compute_frontiers ""
  661. mz_compute_import_frontiers ""
  662. mz_compute_operator_durations_histogram ""
  663. mz_compute_operator_durations_histogram_per_worker ""
  664. mz_dataflow_addresses ""
  665. mz_dataflow_arrangement_sizes ""
  666. mz_dataflow_channel_operators ""
  667. mz_dataflow_channel_operators_per_worker ""
  668. mz_dataflow_channels ""
  669. mz_dataflow_global_ids ""
  670. mz_dataflow_operator_dataflows ""
  671. mz_dataflow_operator_dataflows_per_worker ""
  672. mz_dataflow_operator_parents ""
  673. mz_dataflow_operator_parents_per_worker ""
  674. mz_dataflow_operator_reachability ""
  675. mz_dataflow_operator_reachability_per_worker ""
  676. mz_dataflow_operators ""
  677. mz_dataflow_shutdown_durations_histogram ""
  678. mz_dataflow_shutdown_durations_histogram_per_worker ""
  679. mz_dataflows ""
  680. mz_dataflows_per_worker ""
  681. mz_expected_group_size_advice ""
  682. mz_lir_mapping ""
  683. mz_mappable_objects ""
  684. mz_message_counts ""
  685. mz_message_counts_per_worker ""
  686. mz_peek_durations_histogram ""
  687. mz_peek_durations_histogram_per_worker ""
  688. mz_records_per_dataflow ""
  689. mz_records_per_dataflow_operator ""
  690. mz_records_per_dataflow_operator_per_worker ""
  691. mz_records_per_dataflow_per_worker ""
  692. mz_scheduling_elapsed ""
  693. mz_scheduling_elapsed_per_worker ""
  694. mz_scheduling_parks_histogram ""
  695. mz_scheduling_parks_histogram_per_worker ""
  696. > SET database = materialize
  697. > CREATE SCHEMA tester
  698. > SHOW TABLES FROM tester
  699. > CREATE TABLE tester.test_table (a int)
  700. > SHOW TABLES FROM tester
  701. test_table ""
  702. # `SHOW TABLES` and `mz_tables` should agree.
  703. > SELECT COUNT(*) FROM mz_tables WHERE id LIKE 's%'
  704. 61
  705. # There is one entry in mz_indexes for each field_number/expression of the index.
  706. > SELECT COUNT(id) FROM mz_indexes WHERE id LIKE 's%'
  707. 257
  708. # Create a second schema with the same table name as above
  709. > CREATE SCHEMA tester2
  710. > CREATE TABLE tester2.test_table (a int)
  711. $ psql-execute command="\dt tester.*"
  712. \ List of relations
  713. Schema | Name | Type | Owner
  714. --------+------------+-------+-------------
  715. tester | test_table | table | materialize
  716. $ psql-execute command="\dt tester.test_table"
  717. \ List of relations
  718. Schema | Name | Type | Owner
  719. --------+------------+-------+-------------
  720. tester | test_table | table | materialize
  721. $ psql-execute command="\dt *.test_table"
  722. \ List of relations
  723. Schema | Name | Type | Owner
  724. ---------+------------+-------+-------------
  725. tester | test_table | table | materialize
  726. tester2 | test_table | table | materialize
  727. > CREATE TYPE type1 AS LIST (ELEMENT TYPE = text)
  728. > SHOW TYPES
  729. type1 ""
  730. $ psql-execute command="\dT"
  731. \ List of data types
  732. Schema | Name | Description
  733. ------------+-------------------+-------------
  734. mz_catalog | anycompatiblelist |
  735. mz_catalog | anycompatiblemap |
  736. mz_catalog | list |
  737. mz_catalog | map |
  738. mz_catalog | mz_aclitem |
  739. mz_catalog | mz_timestamp |
  740. mz_catalog | uint2 |
  741. mz_catalog | uint4 |
  742. mz_catalog | uint8 |
  743. public | type1 |