From f26b91761bd25f9da2f97d818f60ae68588888c2 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 26 Aug 2005 03:08:15 +0000 Subject: Arrange for indexes and toast tables to inherit their ownership from the parent table, even if the command that creates them is executed by someone else (such as a superuser or a member of the owning role). Per gripe from Michael Fuhr. --- src/backend/commands/tablecmds.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/backend/commands/tablecmds.c') diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 91f5eaecd95..7bf1d297a7a 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.169 2005/08/23 22:40:07 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.170 2005/08/26 03:07:16 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -427,6 +427,7 @@ DefineRelation(CreateStmt *stmt, char relkind) namespaceId, tablespaceId, InvalidOid, + GetUserId(), descriptor, relkind, false, @@ -5946,6 +5947,7 @@ AlterTableCreateToastTable(Oid relOid, bool silent) PG_TOAST_NAMESPACE, rel->rd_rel->reltablespace, InvalidOid, + rel->rd_rel->relowner, tupdesc, RELKIND_TOASTVALUE, shared_relation, -- cgit v1.2.3