|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * 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 $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
|
25 | 25 | #include"commands/creatinh.h"
|
26 | 26 | #include"miscadmin.h"
|
27 | 27 | #include"optimizer/clauses.h"
|
| 28 | +#include"utils/acl.h" |
28 | 29 | #include"utils/syscache.h"
|
29 | 30 | #include"utils/temprel.h"
|
30 | 31 |
|
@@ -384,6 +385,12 @@ MergeAttributes(List *schema, List *supers, bool istemp,
|
384 | 385 | if (!istemp&&is_temp_rel_name(name))
|
385 | 386 | elog(ERROR,"CREATE TABLE: cannot inherit from temp relation \"%s\"",name);
|
386 | 387 |
|
| 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 | + |
387 | 394 | parentOids=lappendi(parentOids,relation->rd_id);
|
388 | 395 | setRelhassubclassInRelation(relation->rd_id, true);
|
389 | 396 | tupleDesc=RelationGetDescr(relation);
|
|