Updated on 2025-05-29 GMT+08:00

PG_ATTRDEF

PG_ATTRDEF records default values of columns.

Table 1 PG_ATTRDEF columns

Name

Type

Description

oid

oid

Row identifier (hidden attribute, which must be specified).

adrelid

oid

Table to which a column belongs.

adnum

smallint

Number of columns.

adbin

pg_node_tree

Internal representation of the default value of a column or of a generated expression.

adsrc

text

Readable representation of the default value of a column or of a generated expression.

adgencol

"char"

Specifies whether a column is a generated column. The value 's' indicates that the column is a generated column, and the value '\0' indicates that the column is an ordinary column. The default value is '\0'.

adbin_on_update

pg_node_tree

Internal representation of the attribute expression on update current_timestamp of the column.

adsrc_on_update

text

Internal representation of the readable attribute expression on update current_timestamp.

adbin_extend

pg_node_tree

Internal representation of a generated expression. In the scenario where a generated column references another generated column, the generated expression does not contain the generated column reference. The adbin column expands the referenced generated column to an equivalent form in the generated expression.