Re: postmaster -d option (was Re: [GENERAL] Relation 0 does

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: Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: postmaster -d option (was Re: [GENERAL] Relation 0 does
Date: 2002-09-27 03:58:20
Message-ID: 200209270358.g8R3wKM00623@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > diff -c -c -r1.294 postgres.c
> > *** src/backend/tcop/postgres.c 25 Sep 2002 20:31:40 -0000 1.294
> > --- src/backend/tcop/postgres.c 26 Sep 2002 05:15:41 -0000
> > ***************
> > *** 1281,1288 ****
> > * -d 0 allows user to prevent postmaster debug
> > * from propagating to backend.
> > */
> > ! SetConfigOption("server_min_messages", "notice",
> > ! ctx, gucsource);
> > }
> > break;
>
> > --- 1281,1287 ----
> > * -d 0 allows user to prevent postmaster debug
> > * from propagating to backend.
> > */
> > ! ResetPGVariable("server_min_messages");
> > }
> > break;
>

Turns out I had to revert this change. There isn't a username at this
point in the code so the ResetPGVariable username test fails, and even
then, I don't think there is any way to set a variable to the value
before -d5 set it.

> If you want "export PGOPTIONS=-d0" to do what the comment says, you'd
> also need to Reset all of the other GUC variables that -dN might have
> set. However, I'm not sure that I agree with the goal in the first
> place. If the admin has set debugging on the postmaster command line,
> should it really be possible for users to turn it off so easily?

I see what you are saying, that you can pass -d0 from the client and
undo the -d5. Yes, I was wondering about that because even on the
command line, if you do -d5 -d0, you still get those extra options.

OK, attached patch applied. The restriction that you can't lower the
debug level with PGOPTIONS is a separate issue. What I clearly didn't
want to do was to reset those other options for -d0, and I didn't have
to do that for -d0 to work as advertised.

--
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 2.8 KB

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-09-27 04:14:42 Re: get date in binary number format
Previous Message Tom Lane 2002-09-27 03:56:23 Re: Fwd: Sizes of sequences and serials

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-09-27 04:00:47 Re: Cascaded Column Drop
Previous Message Tom Lane 2002-09-27 03:47:08 Re: Cascaded Column Drop