aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/tablecmds.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-02-07 17:09:51 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-02-07 17:09:51 +0000
commitb7fe5f70d32fcc56c425d5d35fa1f7c27c99ab37 (patch)
treee0e0348013741558bc3ed75c282df5436c7cb4b1 /src/backend/commands/tablecmds.c
parent26351d1c747f6e682e0f1ba05b41be64c3f98dae (diff)
downloadpostgresql-b7fe5f70d32fcc56c425d5d35fa1f7c27c99ab37.tar.gz
postgresql-b7fe5f70d32fcc56c425d5d35fa1f7c27c99ab37.zip
Fix CREATE TABLE ... LIKE ... INCLUDING INDEXES to not cause unwanted
tablespace permissions failures when copying an index that is in the database's default tablespace. A side-effect of the change is that explicitly specifying the default tablespace no longer triggers a permissions check; this is not how it was done in pre-8.3 releases but is argued to be more consistent. Per bug #3921 from Andrew Gilligan. (Note: I argued in the subsequent discussion that maybe LIKE shouldn't copy index tablespaces at all, but since no one indicated agreement with that idea, I've refrained from doing it.)
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r--src/backend/commands/tablecmds.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 3bd0b4d44de..027fe51eca4 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.241 2008/01/30 19:46:48 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.242 2008/02/07 17:09:51 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -340,7 +340,7 @@ DefineRelation(CreateStmt *stmt, char relkind)
}
/* Check permissions except when using database's default */
- if (OidIsValid(tablespaceId))
+ if (OidIsValid(tablespaceId) && tablespaceId != MyDatabaseTableSpace)
{
AclResult aclresult;