↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / System Catalogs

pg_attrdef

The catalog pg_attrdef stores column default expressions and generation expressions. The main information about columns is stored in pg_attribute. Only columns for which a default expression or generation expression has been explicitly set will have an entry here.

English manual coverage begins with PostgreSQL 7.4. Source history and runtime observations have their own recorded version boundaries.

Reading PG 18·Select a recorded version

kind
catalog
lang
en
measured attributes
true
metadata release
18.6
runtime columns
oid, adrelid, adnum, adbin
runtime verified
false
source
english-manual

Definition PG 18

The catalog pg_attrdef stores column default expressions and generation expressions. The main information about columns is stored in pg_attribute. Only columns for which a default expression or generation expression has been explicitly set will have an entry here.

Catalog columns

ColumnTypeNullabilityDescription
oidoidNot nullRow identifier
adrelidoidNot nullThe table this column belongs to
adnumint2Not nullThe number of the column
adbinpg_node_treeNot nullThe column default or generation expression, in nodeToString() representation. Use pg_get_expr(adbin, adrelid) to convert it to an SQL expression.

Compare versions

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · catalog-bilingual-repair:471cb6997385d2e4964536271ab22e293b13f4be1afd7383c52bb1bef7568590

Text language: en · catalog-bilingual-repair:471cb6997385d2e4964536271ab22e293b13f4be1afd7383c52bb1bef7568590