pgsql: Allow SET TABLESPACE to database default

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Allow SET TABLESPACE to database default
Date: 2014-01-18 23:51:12
Message-ID: E1W4ffU-0001x7-BL@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Allow SET TABLESPACE to database default

We've always allowed CREATE TABLE to create tables in the database's default
tablespace without checking for CREATE permissions on that tablespace.
Unfortunately, the original implementation of ALTER TABLE ... SET TABLESPACE
didn't pick up on that exception.

This changes ALTER TABLE ... SET TABLESPACE to allow the database's default
tablespace without checking for CREATE rights on that tablespace, just as
CREATE TABLE works today. Users could always do this through a series of
commands (CREATE TABLE ... AS SELECT * FROM ...; DROP TABLE ...; etc), so
let's fix the oversight in SET TABLESPACE's original implementation.

Branch
------
REL8_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/0fb4e3cebb32628bdd92d8445ff61d23eb73af48

Modified Files
--------------
src/backend/commands/tablecmds.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Stephen Frost 2014-01-19 00:11:20 pgsql: Add ALTER TABLESPACE ... MOVE command
Previous Message Stephen Frost 2014-01-18 23:51:11 pgsql: Allow SET TABLESPACE to database default