ALTER command reworks

From: Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PgHacker <pgsql-hackers(at)postgresql(dot)org>
Subject: ALTER command reworks
Date: 2012-07-24 05:24:11
Message-ID: CADyhKSXFfP7zXG_0RJxvViZHcRQAq2LXv7KL1b6wpAOAKOg9gg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The attached patch is my homework at the last commit fest of v9.2.

It consolidates some similar routines into a single generic routines
that handles ALTER RENAME TO, OWNER TO and SET SCHEMA
according to the ObjectProperty in objectaddress.c, but here is
no functionality enhancement.

As existing AlterObjectNamespace() doing, this generic routine
handles only case when a catalog entry is updated without any
extra permission checks or other stuffs.
Thus, RenameSchema was not consolidated due to CREATE
permission checks towards the database, for example.

As patched chunk in commands/alter.c shows, 13 of special
routines were consolidated into AlterObjectRename, 16 of
special ones were consolidated into AlterObjectNamespace,
and 20 of special ones were consolidated into AlterObjectOwner().

My motivation is for minimization of number of places to put
object-access-hook around alter statement. Probably, it shall
be located around or just after simple_heap_update().
This is a groundwork towards ALTER command support in
sepgsql module.

Thanks,
--
KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>

Attachment Content-Type Size
pgsql-v9.3-alter-reworks.v1.patch application/octet-stream 160.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-07-24 06:02:19 Re: isolation check takes a long time
Previous Message Peter Eisentraut 2012-07-24 05:14:24 Re: isolation check takes a long time