Re: [HACKERS] [BUGS] 7.4 beta 1: SET log_statement=false

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bertrand Petit <pgsql-bugs(at)phoe(dot)frmug(dot)org>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: [HACKERS] [BUGS] 7.4 beta 1: SET log_statement=false
Date: 2003-09-04 05:06:15
Message-ID: 200309040506.h8456Fr23315@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers pgsql-patches

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Yes, I have been thinking of that. The big question is whether a
> > non-super user can control the reset value?
>
> He could (via PGOPTIONS) ... but since he can only increase it, there is
> nothing to fear.

I have followed your suggestion and applied the following patch to have
PGC_USERLIMIT track reset_val rather than session_val. I now see that
all sources set the default, except SET:

makeDefault = changeVal && (source <= PGC_S_OVERRIDE) && (value != NULL$

typedef enum
{
PGC_S_DEFAULT, /* wired-in default */
PGC_S_ENV_VAR, /* postmaster environment variable */
PGC_S_FILE, /* postgresql.conf */
PGC_S_ARGV, /* postmaster command line */
PGC_S_UNPRIVILEGED, /* dividing line for USERLIMIT */
PGC_S_DATABASE, /* per-database setting */
PGC_S_USER, /* per-user setting */
PGC_S_CLIENT, /* from client connection request */
PGC_S_OVERRIDE, /* special case to forcibly set default$
PGC_S_SESSION /* SET command */
} GucSource;

This fixes the reported problem where log_statement couldn't be turned
on then off in a session by a non-super user.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 4.3 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Ringo 2003-09-04 06:19:24 Re: Is it bug???
Previous Message Tom Lane 2003-09-04 04:37:35 Re: pg_clog problem (maybe)...

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthew T. O'Connor 2003-09-04 05:10:55 Re: Stats Collector Error 7.4beta1 and 7.4beta2
Previous Message Larry Rosenman 2003-09-04 04:40:56 Re: ANONCVS? Is it being updated correctly?

Browse pgsql-patches by date

  From Date Subject
Next Message Mirko Tebaldi 2003-09-04 14:26:45 Fw: New translation
Previous Message Neil Conway 2003-09-04 03:13:09 improve runtime config docs