历史版本。 PostgreSQL 9.2 已结束支持。 2017-11-09. 请参阅 当前版本手册.
45.6. pg_attrdef #
目录pg_attrdef存储列默认值。列的主要信息存储在pg_attribute中(见下文)。只有在创建表或添加列时显式指定默认值的列,才会在这里有一项。
表 45.6. pg_attrdef 列
| Name | Type | References | Description |
|---|---|---|---|
adrelid | oid | | The table this column belongs to |
adnum | int2 | | The number of the column |
adbin | pg_node_tree | The internal representation of the column default value | |
adsrc | text | A human-readable representation of the default value |
adsrc字段是历史遗留,最好不要使用,因为它不会跟踪可能影响默认值表示的外部变化。显示默认值时,更好的方法是反向编译adbin字段(例如使用pg_get_expr)。