Skip site navigation (1) Skip section navigation (2)

pgsql: Refactor "ALTER some-obj SET SCHEMA" implementation

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Refactor "ALTER some-obj SET SCHEMA" implementation
Date: 2012-10-02 21:20:33
Message-ID: E1TJ9tJ-0001h9-Aq@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Refactor "ALTER some-obj SET SCHEMA" implementation

Instead of having each object type implement the catalog munging
independently, centralize knowledge about how to do it and expand the
existing table in objectaddress.c with enough data about each object
type to support this operation.

Author: KaiGai Kohei
Tweaks by me
Reviewed by Robert Haas

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/2164f9a1254980a02ef9ca99ee3bcb8c1298b219

Modified Files
--------------
src/backend/catalog/objectaddress.c   |  268 +++++++++++++++++++++++++++++----
src/backend/commands/alter.c          |  120 ++++++---------
src/backend/commands/collationcmds.c  |    9 +-
src/backend/commands/conversioncmds.c |   50 ------
src/backend/commands/dropcmds.c       |    1 -
src/backend/commands/functioncmds.c   |   33 +---
src/backend/commands/opclasscmds.c    |  104 -------------
src/backend/commands/operatorcmds.c   |   53 -------
src/backend/commands/tsearchcmds.c    |  188 -----------------------
src/backend/nodes/copyfuncs.c         |    1 -
src/backend/nodes/equalfuncs.c        |    1 -
src/backend/parser/gram.y             |    4 +-
src/include/catalog/objectaddress.h   |   12 ++-
src/include/commands/alter.h          |    7 +-
src/include/commands/conversioncmds.h |    2 -
src/include/commands/defrem.h         |   14 --
src/include/nodes/parsenodes.h        |    1 -
17 files changed, 316 insertions(+), 552 deletions(-)

pgsql-committers by date

Next:From: Tom LaneDate: 2012-10-02 21:32:58
Subject: pgsql: Work around unportable behavior of malloc(0) and realloc(NULL,0
Previous:From: Tom LaneDate: 2012-10-02 19:36:38
Subject: pgsql: Standardize naming of malloc/realloc/strdup wrapper functions.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group