array.td 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. # This test exercises solely to test arrays at the boundary (e.g., by sending
  10. # them through pgwire).
  11. > SELECT ARRAY[ARRAY['a', 'b'], ARRAY[NULL, 'd']]
  12. array
  13. ----
  14. {{a,b},{NULL,d}}
  15. > SELECT ARRAY[ARRAY['a', 'b'], ARRAY[NULL, 'd']]::text
  16. array
  17. ----
  18. {{a,b},{NULL,d}}
  19. ! CREATE TABLE foobar (f1 int list[]);
  20. contains:type "int4 list[]" does not exist
  21. ! SELECT ARRAY[LIST[1]];
  22. contains:integer list[] not yet supported
  23. > CREATE TYPE bigint_list AS LIST (ELEMENT TYPE = bigint);
  24. ! CREATE TABLE bigint_list_arr (f1 bigint_list[]);
  25. contains:type "bigint_list[]" does not exist
  26. ! SELECT ARRAY['{a => 1}'::map[text=>int]];
  27. contains:map[text=>integer][] not yet supported
  28. > CREATE TYPE bigint_map AS MAP (KEY TYPE = text, VALUE TYPE = bigint);
  29. ! CREATE TABLE bigint_map_map_array_table (f1 bigint_map[]);
  30. contains:type "bigint_map[]" does not exist
  31. > SELECT array_fill(1, ARRAY[2], ARRAY[3]);
  32. [3:4]={1,1}
  33. # Test that table creation involving array typescorrectly describe their resolved_ids on restart.
  34. # This is asserted by testdrive during its catalog verification step after each DDL.
  35. > CREATE TABLE t1 (a int4[]);
  36. > CREATE TABLE t2 (a _int4);