PostgreSQL Source Code git master
Loading...
Searching...
No Matches
pg_attrdef.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * pg_attrdef.h
4 * definition of the "attribute defaults" system catalog (pg_attrdef)
5 *
6 *
7 * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
9 *
10 * src/include/catalog/pg_attrdef.h
11 *
12 * NOTES
13 * The Catalog.pm module reads this file and derives schema
14 * information.
15 *
16 *-------------------------------------------------------------------------
17 */
18#ifndef PG_ATTRDEF_H
19#define PG_ATTRDEF_H
20
21#include "catalog/genbki.h"
23#include "catalog/pg_attrdef_d.h" /* IWYU pragma: export */
24
25/* ----------------
26 * pg_attrdef definition. cpp turns this into
27 * typedef struct FormData_pg_attrdef
28 * ----------------
29 */
31{
32 Oid oid; /* oid */
33
34 Oid adrelid BKI_LOOKUP(pg_class); /* OID of table containing
35 * attribute */
36 int16 adnum; /* attnum of attribute */
37
38#ifdef CATALOG_VARLEN /* variable-length fields start here */
39 pg_node_tree adbin BKI_FORCE_NOT_NULL; /* nodeToString representation of
40 * default */
41#endif
43
44/* ----------------
45 * Form_pg_attrdef corresponds to a pointer to a tuple with
46 * the format of pg_attrdef relation.
47 * ----------------
48 */
50
52
55
57
58
60 Node *expr, bool is_internal);
61extern void RemoveAttrDefault(Oid relid, AttrNumber attnum,
62 DropBehavior behavior,
63 bool complain, bool internal);
65
68
69#endif /* PG_ATTRDEF_H */
int16 AttrNumber
Definition attnum.h:21
int16_t int16
Definition c.h:541
#define DECLARE_UNIQUE_INDEX_PKEY(name, oid, oidmacro, tblname, decl)
Definition genbki.h:86
#define BKI_LOOKUP(catalog)
Definition genbki.h:46
#define DECLARE_FOREIGN_KEY(cols, reftbl, refcols)
Definition genbki.h:118
#define DECLARE_UNIQUE_INDEX(name, oid, oidmacro, tblname, decl)
Definition genbki.h:85
#define BKI_FORCE_NOT_NULL
Definition genbki.h:33
#define DECLARE_TOAST(name, toastoid, indexoid)
Definition genbki.h:63
#define CATALOG(name, oid, oidmacro)
Definition genbki.h:23
DropBehavior
Oid StoreAttrDefault(Relation rel, AttrNumber attnum, Node *expr, bool is_internal)
Definition pg_attrdef.c:37
FormData_pg_attrdef * Form_pg_attrdef
Definition pg_attrdef.h:49
void RemoveAttrDefaultById(Oid attrdefId)
Definition pg_attrdef.c:209
Oid GetAttrDefaultOid(Oid relid, AttrNumber attnum)
Definition pg_attrdef.c:280
FormData_pg_attrdef
Definition pg_attrdef.h:42
ObjectAddress GetAttrDefaultColumnAddress(Oid attrdefoid)
Definition pg_attrdef.c:322
void RemoveAttrDefault(Oid relid, AttrNumber attnum, DropBehavior behavior, bool complain, bool internal)
Definition pg_attrdef.c:154
int16 attnum
unsigned int Oid
static int fb(int x)
Definition nodes.h:135