Re: reset all update

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Marko Kreen <marko(at)l-t(dot)ee>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: reset all update
Date: 2001-06-12 21:24:12
Message-ID: 200106122124.f5CLOCI25374@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Your patch has been added to the PostgreSQL unapplied patches list at:

http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

> On Tue, Jun 12, 2001 at 10:05:29PM +0200, Peter Eisentraut wrote:
> > Marko Kreen writes:
> >
> > > On Tue, Jun 12, 2001 at 09:37:43PM +0200, Peter Eisentraut wrote:
> > > > Marko Kreen writes:
> > > > > *** src/backend/tcop/postgres.c 2001/06/07 04:50:57 1.219
> > > > > --- src/backend/tcop/postgres.c 2001/06/11 09:17:07
> > > > > + ctx = IsUnderPostmaster ? PGC_BACKEND : PGC_POSTMASTER;
> > > > > +
> > > >
> > > > This is wrong. If you're in PostgresMain then the context is PGC_BACKEND
> > > > -- by definition.
> > >
> > > Well, but how do you explain this: (line 1463 in current CVS):
> > >
> > > /* all options are allowed if not under postmaster */
> > > SetConfigOption(name, value,
> > > (IsUnderPostmaster) ? PGC_BACKEND : PGC_POSTMASTER, true);
> > >
> > > As I understand, when you run ./postgres directly, you get
> > > PGC_POSTMASTER, which includes PGC_BACKEND.
> >
> > You're right. Objection withdrawn. ;-)
>
> :)
>
> The following should be applied on top of previous patch.
> Moved the comment too.
>
> --
> marko
>
>
> *** src/backend/tcop/postgres.c.orig Tue Jun 12 21:53:26 2001
> --- src/backend/tcop/postgres.c Tue Jun 12 22:07:42 2001
> ***************
> *** 1119,1124 ****
> --- 1119,1125 ----
>
> char *potential_DataDir = NULL;
>
> + /* all options are allowed if not under postmaster */
> ctx = IsUnderPostmaster ? PGC_BACKEND : PGC_POSTMASTER;
>
> /*
> ***************
> *** 1465,1473 ****
> elog(ERROR, "-c %s requires argument", optarg);
> }
>
> ! /* all options are allowed if not under postmaster */
> ! SetConfigOption(name, value,
> ! (IsUnderPostmaster) ? PGC_BACKEND : PGC_POSTMASTER, true);
> free(name);
> if (value)
> free(value);
> --- 1466,1472 ----
> elog(ERROR, "-c %s requires argument", optarg);
> }
>
> ! SetConfigOption(name, value, ctx, true);
> free(name);
> if (value)
> free(value);
> *** src/backend/utils/misc/guc.c.orig Tue Jun 12 21:50:51 2001
> --- src/backend/utils/misc/guc.c Tue Jun 12 22:19:23 2001
> ***************
> *** 448,457 ****
> cf->default_val = str;
> }
>
> ! if (!cf->variable || !cf->default_val)
> ! continue;
> !
> ! if (!*cf->variable || strcmp(cf->default_val, *cf->variable))
> set_config_option_real(PGC_STRING, (struct config_generic *)cf,
> cf->default_val, true, false, ERROR);
> }
> --- 448,454 ----
> cf->default_val = str;
> }
>
> ! if (*cf->variable == NULL || strcmp(cf->default_val, *cf->variable) != 0)
> set_config_option_real(PGC_STRING, (struct config_generic *)cf,
> cf->default_val, true, false, ERROR);
> }
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2001-06-12 22:54:34 Re: take 2: show all / reset all
Previous Message Marko Kreen 2001-06-12 20:47:28 Re: reset all update