psql -U postgres psql (9.5.3) Type "help" for help.
postgres=# create domain text char(3); CREATE DOMAIN postgres=# create domain text char(2); ERROR: type "text" already exists postgres=# \dD List of domains Schema | Name | Type | Modifier | Check --------+------+------+----------+------- (0 rows)
postgres=# create domain textd char(2); CREATE DOMAIN postgres=# \dD List of domains Schema | Name | Type | Modifier | Check --------+-------+--------------+----------+------- public | textd | character(2) | | (1 row)
It's there.
# create domain text char(3);
CREATE DOMAIN
labels_search=# \dD public.text
List of domains
Schema | Name | Type | Modifier | Check
--------+------+--------------+----------+-------
public | text | character(3) | |
(1 row)
I've noticed the same thing when creating types that mask an existing catalog type.