summaryrefslogtreecommitdiff
path: root/src/include/catalog/heap.h
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2015-03-25 17:17:56 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2015-03-25 17:17:56 -0300
commitbdc3d7fa2376a7a1e977383cc3221cfe44c4a893 (patch)
tree6e72d8c519968316ab04546ff89e0b0ff328b82d /src/include/catalog/heap.h
parent06bf0dd6e354c765403d1331cc9896b360754521 (diff)
downloadpostgresql-bdc3d7fa2376a7a1e977383cc3221cfe44c4a893.tar.gz
Return ObjectAddress in many ALTER TABLE sub-routines
Since commit a2e35b53c39b2a, most CREATE and ALTER commands return the ObjectAddress of the affected object. This is useful for event triggers to try to figure out exactly what happened. This patch extends this idea a bit further to cover ALTER TABLE as well: an auxiliary ObjectAddress is returned for each of several subcommands of ALTER TABLE. This makes it possible to decode with precision what happened during execution of any ALTER TABLE command; for instance, which constraint was added by ALTER TABLE ADD CONSTRAINT, or which parent got dropped from the parents list by ALTER TABLE NO INHERIT. As with the previous patch, there is no immediate user-visible change here. This is all really just continuing what c504513f83a9ee8 started. Reviewed by Stephen Frost.
Diffstat (limited to 'src/include/catalog/heap.h')
-rw-r--r--src/include/catalog/heap.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/catalog/heap.h b/src/include/catalog/heap.h
index 573b2deb2d..e6ac3943fc 100644
--- a/src/include/catalog/heap.h
+++ b/src/include/catalog/heap.h
@@ -28,6 +28,7 @@ typedef struct RawColumnDefault
typedef struct CookedConstraint
{
ConstrType contype; /* CONSTR_DEFAULT or CONSTR_CHECK */
+ Oid conoid; /* constr OID if created, otherwise Invalid */
char *name; /* name, or NULL if none */
AttrNumber attnum; /* which attr (only for DEFAULT) */
Node *expr; /* transformed default or check expr */
@@ -101,7 +102,7 @@ extern List *AddRelationNewConstraints(Relation rel,
bool is_local,
bool is_internal);
-extern void StoreAttrDefault(Relation rel, AttrNumber attnum,
+extern Oid StoreAttrDefault(Relation rel, AttrNumber attnum,
Node *expr, bool is_internal);
extern Node *cookDefault(ParseState *pstate,