12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- # Copyright Materialize, Inc. and contributors. All rights reserved.
- #
- # Use of this software is governed by the Business Source License
- # included in the LICENSE file at the root of this repository.
- #
- # As of the Change Date specified in that file, in accordance with
- # the Business Source License, use of this software will be governed
- # by the Apache License, Version 2.0.
- > SELECT id, key_id, value_id, key_modifiers::text, value_modifiers::text FROM mz_map_types;
- > SHOW TYPES
- > CREATE TYPE bool AS MAP (KEY TYPE = text, VALUE TYPE = int4)
- > CREATE TYPE custom AS MAP (KEY TYPE = text, VALUE TYPE = bool)
- $ set-regex match=^s\d*$ replacement=<GID>
- # Without qualifiers, should default to builtin bool.
- > SELECT value_id
- FROM mz_map_types JOIN mz_types ON mz_map_types.id = mz_types.id
- WHERE name = 'custom'
- <GID>
- > CREATE TYPE another_custom AS MAP (KEY TYPE = text, VALUE TYPE = public.bool)
- $ set-regex match=^u\d*$ replacement=<GID>
- # Qualified name should point to user-defined bool.
- > SELECT value_id
- FROM mz_map_types JOIN mz_types ON mz_map_types.id = mz_types.id
- WHERE name = 'another_custom'
- <GID>
- > CREATE SCHEMA test_schema
- > CREATE TYPE test_schema.bool AS MAP (KEY TYPE = text, VALUE TYPE = float4)
- > SHOW TYPES
- name comment
- -----------------------
- bool ""
- custom ""
- another_custom ""
- > SHOW TYPES FROM test_schema
- name comment
- ---------------
- bool ""
- ! DROP TYPE bool
- contains:cannot drop type bool because it is required by the database system
- ! DROP TYPE public.bool
- contains:cannot drop type "public.bool": still depended upon by type "another_custom"
- > DROP TYPE another_custom
- > DROP TYPE public.bool
|