pg_catalog_attribute.slt 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. # Verify that pg_attribute works for all column types.
  11. statement ok
  12. CREATE TABLE coltypes(
  13. c__bool _bool,
  14. c__bpchar _bpchar,
  15. c__bytea _bytea,
  16. c__char _char,
  17. c__date _date,
  18. c__float4 _float4,
  19. c__float8 _float8,
  20. c__int2 _int2,
  21. c__int4 _int4,
  22. c__int8 _int8,
  23. c__interval _interval,
  24. c__jsonb _jsonb,
  25. c__numeric _numeric,
  26. c__oid _oid,
  27. c__regproc _regproc,
  28. c__text _text,
  29. c__time _time,
  30. c__timestamp _timestamp,
  31. c__timestamptz _timestamptz,
  32. c__uuid _uuid,
  33. c__varchar _varchar,
  34. c_bool bool,
  35. c_bpchar bpchar,
  36. c_bytea bytea,
  37. c_char char,
  38. c_date date,
  39. c_float4 float4,
  40. c_float8 float8,
  41. c_int2 int2,
  42. c_int4 int4,
  43. c_int8 int8,
  44. c_interval interval,
  45. c_jsonb jsonb,
  46. c_numeric numeric,
  47. c_oid oid,
  48. c_regproc regproc,
  49. c_text text,
  50. c_time time,
  51. c_timestamp timestamp,
  52. c_timestamptz timestamptz,
  53. c_uuid uuid,
  54. c_varchar varchar,
  55. c_varchar10 varchar(10)
  56. );
  57. ----
  58. query ITI
  59. SELECT atttypid, attname, atttypmod FROM pg_attribute WHERE attrelid = (SELECT oid FROM mz_tables WHERE name='coltypes') ORDER BY atttypid
  60. ----
  61. 16 c_bool -1
  62. 17 c_bytea -1
  63. 20 c_int8 -1
  64. 21 c_int2 -1
  65. 23 c_int4 -1
  66. 24 c_regproc -1
  67. 25 c_text -1
  68. 26 c_oid -1
  69. 700 c_float4 -1
  70. 701 c_float8 -1
  71. 1000 c__bool -1
  72. 1001 c__bytea -1
  73. 1002 c__char -1
  74. 1005 c__int2 -1
  75. 1007 c__int4 -1
  76. 1008 c__regproc -1
  77. 1009 c__text -1
  78. 1014 c__bpchar -1
  79. 1015 c__varchar -1
  80. 1016 c__int8 -1
  81. 1021 c__float4 -1
  82. 1022 c__float8 -1
  83. 1028 c__oid -1
  84. 1042 c_char 5
  85. 1042 c_bpchar 5
  86. 1043 c_varchar -1
  87. 1043 c_varchar10 14
  88. 1082 c_date -1
  89. 1083 c_time -1
  90. 1114 c_timestamp -1
  91. 1115 c__timestamp -1
  92. 1182 c__date -1
  93. 1183 c__time -1
  94. 1184 c_timestamptz -1
  95. 1185 c__timestamptz -1
  96. 1186 c_interval -1
  97. 1187 c__interval -1
  98. 1231 c__numeric -1
  99. 1700 c_numeric 2555947
  100. 2950 c_uuid -1
  101. 2951 c__uuid -1
  102. 3802 c_jsonb -1
  103. 3807 c__jsonb -1
  104. # Generated queries are unsupported
  105. query B
  106. SELECT DISTINCT(attgenerated = '') FROM pg_attribute
  107. ----
  108. true