pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Change many routines to return ObjectAddress rather than OID
Date: Tue, 03 Mar 2015 17:18:56 +0000
Message-ID: <E1YSqTA-00074K-K9@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Change many routines to return ObjectAddress rather than OID

The changed routines are mostly those that can be directly called by
ProcessUtilitySlow; the intention is to make the affected object
information more precise, in support for future event trigger changes.
Originally it was envisioned that the OID of the affected object would
be enough, and in most cases that is correct, but upon actually
implementing the event trigger changes it turned out that ObjectAddress
is more widely useful.

Additionally, some command execution routines grew an output argument
that's an object address which provides further info about the executed
command.  To wit:

* for ALTER DOMAIN / ADD CONSTRAINT, it corresponds to the address of
  the new constraint

* for ALTER OBJECT / SET SCHEMA, it corresponds to the address of the
  schema that originally contained the object.

* for ALTER EXTENSION {ADD, DROP} OBJECT, it corresponds to the address
  of the object added to or dropped from the extension.

There's no user-visible change in this commit, and no functional change
either.

Discussion: 20150218213255.GC6717@tamriel.snowman.net
Reviewed-By: Stephen Frost, Andres Freund

Branch
------
master

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

Modified Files
--------------
src/backend/bootstrap/bootparse.y      |    3 +-
src/backend/catalog/heap.c             |   28 ++--
src/backend/catalog/objectaddress.c    |    6 +
src/backend/catalog/pg_aggregate.c     |   56 ++++---
src/backend/catalog/pg_conversion.c    |    4 +-
src/backend/catalog/pg_operator.c      |   13 +-
src/backend/catalog/pg_proc.c          |    4 +-
src/backend/catalog/pg_type.c          |   20 ++-
src/backend/catalog/toasting.c         |    3 +-
src/backend/commands/aggregatecmds.c   |    2 +-
src/backend/commands/alter.c           |   55 ++++---
src/backend/commands/cluster.c         |    3 +-
src/backend/commands/collationcmds.c   |    7 +-
src/backend/commands/comment.c         |    8 +-
src/backend/commands/conversioncmds.c  |    2 +-
src/backend/commands/createas.c        |   40 ++---
src/backend/commands/dbcommands.c      |   14 +-
src/backend/commands/event_trigger.c   |    7 +-
src/backend/commands/extension.c       |   64 +++++---
src/backend/commands/foreigncmds.c     |   51 ++++---
src/backend/commands/functioncmds.c    |   17 ++-
src/backend/commands/indexcmds.c       |   13 +-
src/backend/commands/matview.c         |    7 +-
src/backend/commands/opclasscmds.c     |   17 ++-
src/backend/commands/operatorcmds.c    |    2 +-
src/backend/commands/policy.c          |   15 +-
src/backend/commands/proclang.c        |  156 +++++++++----------
src/backend/commands/schemacmds.c      |   14 +-
src/backend/commands/seclabel.c        |    6 +-
src/backend/commands/sequence.c        |   19 ++-
src/backend/commands/tablecmds.c       |  103 ++++++++-----
src/backend/commands/tablespace.c      |    7 +-
src/backend/commands/trigger.c         |   20 ++-
src/backend/commands/tsearchcmds.c     |   62 +++++---
src/backend/commands/typecmds.c        |  259 ++++++++++++++++++--------------
src/backend/commands/user.c            |    7 +-
src/backend/commands/view.c            |   25 +--
src/backend/rewrite/rewriteDefine.c    |   16 +-
src/backend/tcop/utility.c             |   30 ++--
src/include/catalog/heap.h             |    6 +-
src/include/catalog/objectaddress.h    |   12 ++
src/include/catalog/pg_aggregate.h     |    3 +-
src/include/catalog/pg_conversion_fn.h |    5 +-
src/include/catalog/pg_operator.h      |    3 +-
src/include/catalog/pg_proc_fn.h       |    3 +-
src/include/catalog/pg_type_fn.h       |    5 +-
src/include/commands/alter.h           |    8 +-
src/include/commands/collationcmds.h   |    3 +-
src/include/commands/comment.h         |    3 +-
src/include/commands/conversioncmds.h  |    3 +-
src/include/commands/createas.h        |    3 +-
src/include/commands/dbcommands.h      |    5 +-
src/include/commands/defrem.h          |   45 +++---
src/include/commands/event_trigger.h   |    2 +-
src/include/commands/extension.h       |   13 +-
src/include/commands/matview.h         |    3 +-
src/include/commands/policy.h          |    7 +-
src/include/commands/proclang.h        |    3 +-
src/include/commands/schemacmds.h      |    5 +-
src/include/commands/seclabel.h        |    2 +-
src/include/commands/sequence.h        |    5 +-
src/include/commands/tablecmds.h       |   15 +-
src/include/commands/tablespace.h      |    3 +-
src/include/commands/trigger.h         |    5 +-
src/include/commands/typecmds.h        |   30 ++--
src/include/commands/user.h            |    3 +-
src/include/commands/view.h            |    3 +-
src/include/rewrite/rewriteDefine.h    |    7 +-
68 files changed, 840 insertions(+), 558 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1YSqTA-00074K-K9@gemulon.postgresql.org>
Permalink:  ../E1YSqTA-00074K-K9@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1YSqTA-00074K-K9@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Change many routines to return ObjectAddress rather than OID
  In-Reply-To: <E1YSqTA-00074K-K9@gemulon.postgresql.org>
  References: <E1YSqTA-00074K-K9@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox