list.td 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. > SELECT id, element_id, element_modifiers::text FROM mz_list_types;
  10. > SHOW TYPES
  11. > CREATE TYPE bool AS LIST (ELEMENT TYPE = int4)
  12. > CREATE TYPE custom AS LIST (ELEMENT TYPE = bool)
  13. $ set-regex match=^s\d*$ replacement=<GID>
  14. # Without qualifiers, should default to builtin bool.
  15. > SELECT element_id
  16. FROM mz_list_types JOIN mz_types ON mz_list_types.id = mz_types.id
  17. WHERE name = 'custom'
  18. <GID>
  19. > CREATE TYPE another_custom AS LIST (ELEMENT TYPE = public.bool)
  20. $ set-regex match=^u\d*$ replacement=<GID>
  21. # Qualified name should point to user-defined bool.
  22. > SELECT element_id
  23. FROM mz_list_types JOIN mz_types ON mz_list_types.id = mz_types.id
  24. WHERE name = 'another_custom'
  25. <GID>
  26. > CREATE SCHEMA test_schema
  27. > CREATE TYPE test_schema.bool AS LIST (ELEMENT TYPE = float4)
  28. > SHOW TYPES
  29. name comment
  30. -----------------------
  31. bool ""
  32. custom ""
  33. another_custom ""
  34. > SHOW TYPES FROM test_schema
  35. name comment
  36. -------------
  37. bool ""
  38. ! DROP TYPE bool
  39. contains:cannot drop type bool because it is required by the database system
  40. ! DROP TYPE public.bool
  41. contains:cannot drop type "public.bool": still depended upon by type "another_custom"
  42. > DROP TYPE another_custom
  43. > DROP TYPE public.bool
  44. ! CREATE TABLE f1 (a char list);
  45. contains:char list not yet supported
  46. ! CREATE TYPE test_schema.bool AS LIST (ELEMENT TYPE = char)
  47. contains:embedding char type in a list or map not yet supported