Prevent ALTER USER f RESET ALL from removing the settings that were put there

by a superuser -- "ALTER USER f RESET setting" already disallows removing such a
setting.

Apply the same treatment to ALTER DATABASE d RESET ALL when run by a database
owner that's not superuser.
This commit is contained in:
Alvaro Herrera
2010-03-25 14:44:34 +00:00
parent 92fc0db99f
commit be8cebc717
4 changed files with 124 additions and 13 deletions

View File

@ -7,7 +7,7 @@
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* $PostgreSQL: pgsql/src/include/utils/guc.h,v 1.112 2010/01/26 16:33:40 tgl Exp $
* $PostgreSQL: pgsql/src/include/utils/guc.h,v 1.113 2010/03/25 14:44:34 alvherre Exp $
*--------------------------------------------------------------------
*/
#ifndef GUC_H
@ -284,6 +284,7 @@ extern void ProcessGUCArray(ArrayType *array,
GucContext context, GucSource source, GucAction action);
extern ArrayType *GUCArrayAdd(ArrayType *array, const char *name, const char *value);
extern ArrayType *GUCArrayDelete(ArrayType *array, const char *name);
extern ArrayType *GUCArrayReset(ArrayType *array);
extern int GUC_complaint_elevel(GucSource source);