假设我们定义了一个postgresql类型:
CREATE TYPE my_type AS ENUM('foo', 'bar');
有没有办法在创建后显示类型定义?
我希望"\d my_type"会显示"ENUM('foo','bar'),但它说:
Did not find any relation named "my_type"
pg_类型表似乎没有提供足够的信息.
假设我们定义了一个postgresql类型:
CREATE TYPE my_type AS ENUM('foo', 'bar');
有没有办法在创建后显示类型定义?
我希望"\d my_type"会显示"ENUM('foo','bar'),但它说:
Did not find any relation named "my_type"
pg_类型表似乎没有提供足够的信息.
它是\dT您想要的,但它不会作为"CREATE"语句给出.您将\dD用于域.
\dT+ action.action_status
List of data types
Schema | Name | Internal name | Size | Elements | Description
--------+----------------------+---------------+------+----------+-------------
action | action.action_status | action_status | 4 | pending +|
| | | | live +|
| | | | done +|
| | | | notdone |
(1 row)