]> granicus.if.org Git - postgresql/commit
Allow SET TABLESPACE to database default
authorStephen Frost <sfrost@snowman.net>
Sat, 18 Jan 2014 23:41:52 +0000 (18:41 -0500)
committerStephen Frost <sfrost@snowman.net>
Sat, 18 Jan 2014 23:50:29 +0000 (18:50 -0500)
commite70c4282136e07ab3a0e57f3c811de80e4318d9f
tree4d89c6054a7adde129fd7038868cf365e69a4474
parent2346c383af7d9dbb2b8609cc407658ff30f86155
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.
src/backend/commands/tablecmds.c