From 1a6bb6d877f60c377635c4e83a1b75ca2f437951 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 13 Jun 2001 21:44:41 +0000 Subject: Allow a non-superuser database owner to vacuum all tables in his database, including system catalogs (but not the shared catalogs, since they don't really belong to his database). This is per recent mailing list discussion. Clean up some other code that also checks for database ownerness by introducing a test function is_dbadmin(). --- src/backend/commands/proclang.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/backend/commands/proclang.c') diff --git a/src/backend/commands/proclang.c b/src/backend/commands/proclang.c index 43327c7a65a..120c5d8b008 100644 --- a/src/backend/commands/proclang.c +++ b/src/backend/commands/proclang.c @@ -3,20 +3,26 @@ * proclang.c * PostgreSQL PROCEDURAL LANGUAGE support code. * + * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql/src/backend/commands/proclang.c,v 1.28 2001/06/13 21:44:40 tgl Exp $ + * *------------------------------------------------------------------------- */ -#include - #include "postgres.h" +#include + #include "access/heapam.h" #include "catalog/catname.h" #include "catalog/indexing.h" #include "catalog/pg_language.h" #include "catalog/pg_proc.h" -#include "catalog/pg_shadow.h" #include "commands/proclang.h" #include "fmgr.h" +#include "miscadmin.h" #include "utils/builtins.h" #include "utils/syscache.h" @@ -63,10 +69,8 @@ CreateProceduralLanguage(CreatePLangStmt *stmt) * Check permission */ if (!superuser()) - { elog(ERROR, "Only users with Postgres superuser privilege are " "permitted to create procedural languages"); - } /* * Translate the language name and check that this language doesn't @@ -150,10 +154,8 @@ DropProceduralLanguage(DropPLangStmt *stmt) * Check permission */ if (!superuser()) - { elog(ERROR, "Only users with Postgres superuser privilege are " "permitted to drop procedural languages"); - } /* * Translate the language name, check that this language exist and is -- cgit v1.2.3