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
| Column | Type | Nullability | Description |
|---|---|---|---|
| oid | oid | Not null | Row identifier |
| adrelid | oid | Not null | The table this column belongs to |
| adnum | int2 | Not null | The number of the column |
| adbin | pg_node_tree | Not null | The 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