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

Commite62c38d

Browse files
committed
Disallow creation of a child table by a user who does not own the parent
table, per pghackers discussion around 22-Dec-00.
1 parent2177572 commite62c38d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎src/backend/commands/creatinh.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.69 2000/12/22 23:12:05 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.70 2001/01/05 02:58:16 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -25,6 +25,7 @@
2525
#include"commands/creatinh.h"
2626
#include"miscadmin.h"
2727
#include"optimizer/clauses.h"
28+
#include"utils/acl.h"
2829
#include"utils/syscache.h"
2930
#include"utils/temprel.h"
3031

@@ -384,6 +385,12 @@ MergeAttributes(List *schema, List *supers, bool istemp,
384385
if (!istemp&&is_temp_rel_name(name))
385386
elog(ERROR,"CREATE TABLE: cannot inherit from temp relation \"%s\"",name);
386387

388+
/* We should have an UNDER permission flag for this, but for now,
389+
* demand that creator of a child table own the parent.
390+
*/
391+
if (!pg_ownercheck(GetUserId(),name,RELNAME))
392+
elog(ERROR,"you do not own table \"%s\"",name);
393+
387394
parentOids=lappendi(parentOids,relation->rd_id);
388395
setRelhassubclassInRelation(relation->rd_id, true);
389396
tupleDesc=RelationGetDescr(relation);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp