mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
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.)
This commit is contained in:
src
backend
include
nodes
@ -26,7 +26,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.302 2008/01/01 19:45:49 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.303 2008/02/07 17:09:51 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -2594,7 +2594,7 @@ OpenIntoRel(QueryDesc *queryDesc)
|
||||
}
|
||||
|
||||
/* Check permissions except when using the database's default space */
|
||||
if (OidIsValid(tablespaceId))
|
||||
if (OidIsValid(tablespaceId) && tablespaceId != MyDatabaseTableSpace)
|
||||
{
|
||||
AclResult aclresult;
|
||||
|
||||
|
Reference in New Issue
Block a user