pg_attrdef
目录 pg_attrdef 存储列默认表达式和生成表达式。 列的主要信息存储在 pg_attribute 中。只有显式设置了默认表达式或生成表达式的列才会在这里有条目。
pg_attribute
Table 52.6. \1 字段列说明
\1
Column Type
Description
oid oid
oid
Row identifier
adrelid oid (references pg_class.oid)
adrelid
pg_class
本列所属的表
adnum int2 (references pg_attribute.attnum)
adnum
int2
attnum
列号
adbin pg_node_tree
adbin
pg_node_tree
列的默认表达式或生成表达式,以 nodeToString() 表示形式存储。 使用 pg_get_expr(adbin, adrelid) 可将其转换为 SQL 表达式。
nodeToString()
pg_get_expr(adbin, adrelid)