information_schema_columns.slt 1.2 KB

12345678910111213141516171819202122232425262728293031
  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. mode cockroach
  10. statement ok
  11. CREATE DATABASE other
  12. statement ok
  13. CREATE VIEW other.public.v AS SELECT 1 AS num, 'a' AS char
  14. statement ok
  15. CREATE VIEW v AS SELECT 1 AS num, 'a' AS char
  16. statement ok
  17. CREATE TABLE t (c1 int DEFAULT 1234, c2 int DEFAULT 1 + 2)
  18. query TTTTTTTTTTT colnames,rowsort
  19. SELECT * FROM information_schema.columns WHERE table_name = 'v' OR table_name = 't'
  20. ----
  21. table_catalog table_schema table_name column_name ordinal_position column_default is_nullable data_type character_maximum_length numeric_precision numeric_scale
  22. materialize public t c1 1 1234 YES integer NULL NULL NULL
  23. materialize public t c2 2 1␠+␠2 YES integer NULL NULL NULL
  24. materialize public v char 2 NULL NO text NULL NULL NULL
  25. materialize public v num 1 NULL NO integer NULL NULL NULL