pgsql: Improve behavior of concurrent ALTER TABLE, and do some refactor

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve behavior of concurrent ALTER TABLE, and do some refactor
Date: 2012-01-07 03:42:42
Message-ID: E1RjNB4-0003NL-1k@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Improve behavior of concurrent ALTER TABLE, and do some refactoring.

ALTER TABLE (and ALTER VIEW, ALTER SEQUENCE, etc.) now use a
RangeVarGetRelid callback to check permissions before acquiring a table
lock. We also now use the same callback for all forms of ALTER TABLE,
rather than having separate, almost-identical callbacks for ALTER TABLE
.. SET SCHEMA and ALTER TABLE .. RENAME, and no callback at all for
everything else.

I went ahead and changed the code so that no form of ALTER TABLE works
on foreign tables; you must use ALTER FOREIGN TABLE instead. In 9.1,
it was possible to use ALTER TABLE .. SET SCHEMA or ALTER TABLE ..
RENAME on a foreign table, but not any other form of ALTER TABLE, which
did not seem terribly useful or consistent.

Patch by me; review by Noah Misch.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/1489e2f26a4c0318938b3085f50976512f321d84

Modified Files
--------------
src/backend/commands/alter.c | 3 +-
src/backend/commands/tablecmds.c | 397 +++++++++++++++-----------------------
src/backend/tcop/utility.c | 17 ++-
src/include/commands/tablecmds.h | 7 +-
4 files changed, 170 insertions(+), 254 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2012-01-07 03:55:46 pgsql: Fix backwards logic in previous commit.
Previous Message Tom Lane 2012-01-06 21:05:09 Re: [COMMITTERS] pgsql: Fix breakage from earlier plperl fix.