From: | Marko Kreen <marko(at)l-t(dot)ee> |
---|---|
To: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
Cc: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: use GUC for cmdline |
Date: | 2001-06-21 22:27:50 |
Message-ID: | 20010622002750.A11926@l-t.ee |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-patches |
On Wed, Jun 20, 2001 at 05:43:07PM +0200, Peter Eisentraut wrote:
> Marko Kreen writes:
>
> > I have not fixed the '-o -F', for which the reason is that
> > 'fsync' var has in guc.c context of PGC_SIGHUP. Another
> > such variable is 'log_connections' - it has PGC_SIGHUP
> > and in same time is command-line settable.
> >
> > How should this be fixed? Simpliest would be to change those
> > to PGC_BACKEND.
>
> No. PGC_BACKEND settings have no permission check, because users can pass
> them in from the client with the PGOPTIONS environment variable. The fix
> might involve a non-trivial rearrangement of the way PGOPTIONS is
> processed (might be impossible, because PGC_BACKEND might be useless if
> the setting will only happen after the first table access (pg_shadow)) or
> another context level (might be too much work for one case). At the
> moment you might want to just cheat and fix the context at PGC_POSTMASTER
> for this particular case.
Do you mean following?
--
marko
diff -u src/backend/tcop/postgres.c src/backend/tcop/postgres.c
--- src/backend/tcop/postgres.c
+++ src/backend/tcop/postgres.c
@@ -1225,7 +1225,7 @@
tmp = "true";
SetConfigOption("debug_level", optarg, ctx, true);
if (DebugLvl >= 1);
- SetConfigOption("log_connections", tmp, ctx, true);
+ SetConfigOption("log_connections", tmp, PGC_POSTMASTER, true);
if (DebugLvl >= 2)
SetConfigOption("debug_print_query", tmp, ctx, true);
if (DebugLvl >= 3)
@@ -1258,7 +1258,7 @@
* turn off fsync
*/
if (secure)
- SetConfigOption("fsync", "false", ctx, true);
+ SetConfigOption("fsync", "false", PGC_POSTMASTER, true);
break;
case 'f':
From | Date | Subject | |
---|---|---|---|
Next Message | Marko Kreen | 2001-06-21 23:13:12 | Re: use GUC for cmdline |
Previous Message | Bruce Momjian | 2001-06-21 22:23:58 | Re: [ADMIN] High memory usage [PATCH] |