Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb167d57

Browse files
committed
Ignore tablespace ACLs when ignoring schema ACLs.
The ALTER TABLE ALTER TYPE implementation can issue DROP INDEX andCREATE INDEX to refit existing indexes for the new column type. Sincethis CREATE INDEX is an implementation detail of an index alteration,the ensuing DefineIndex() should skip ACL checks specific to indexcreation. It already skips the namespace ACL check. Make it skip thetablespace ACL check, too. Back-patch to 9.2 (all supported versions).Reviewed by Tom Lane.
1 parent4dd4e3f commitb167d57

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎src/backend/commands/indexcmds.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@ CheckIndexCompatible(Oid oldId,
285285
* 'indexRelationId': normally InvalidOid, but during bootstrap can be
286286
*nonzero to specify a preselected OID for the index.
287287
* 'is_alter_table': this is due to an ALTER rather than a CREATE operation.
288-
* 'check_rights': check for CREATE rights inthenamespace. (This should
289-
*be true except when ALTER is deleting/recreating an index.)
288+
* 'check_rights': check for CREATE rights in namespace and tablespace. (This
289+
*shouldbe true except when ALTER is deleting/recreating an index.)
290290
* 'skip_build': make the catalog entries but leave the index file empty;
291291
*it will be filled later.
292292
* 'quiet': suppress the NOTICE chatter ordinarily provided for constraints.
@@ -421,8 +421,9 @@ DefineIndex(Oid relationId,
421421
/* note InvalidOid is OK in this case */
422422
}
423423

424-
/* Check permissions except when using database's default */
425-
if (OidIsValid(tablespaceId)&&tablespaceId!=MyDatabaseTableSpace)
424+
/* Check tablespace permissions */
425+
if (check_rights&&
426+
OidIsValid(tablespaceId)&&tablespaceId!=MyDatabaseTableSpace)
426427
{
427428
AclResultaclresult;
428429

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp