pgsql: Return ObjectAddress in many ALTER TABLE sub-routines

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Return ObjectAddress in many ALTER TABLE sub-routines
Date: 2015-03-25 20:22:16
Message-ID: E1Yaroe-0006Kr-Sh@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/bdc3d7fa2376a7a1e977383cc3221cfe44c4a893

Modified Files
--------------
src/backend/catalog/heap.c | 98 ++++----
src/backend/catalog/index.c | 9 +-
src/backend/catalog/pg_constraint.c | 2 +
src/backend/commands/tablecmds.c | 419 ++++++++++++++++++++++++++---------
src/include/catalog/heap.h | 3 +-
src/include/catalog/index.h | 3 +-
6 files changed, 380 insertions(+), 154 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2015-03-25 21:49:21 pgsql: Centralize definition of integer limits.
Previous Message Tom Lane 2015-03-25 19:54:34 pgsql: Upgrade src/port/rint.c to be POSIX-compliant.