Re: [PATCHES] guc

From: Liam Stewart <liams(at)redhat(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] guc
Date: 2002-01-18 17:00:59
Message-ID: 20020118120059.A23383@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Thu, Jan 17, 2002 at 05:57:29PM -0500, Tom Lane wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > Liam Stewart writes:
> >> I've removed
> >> GetConfigOption() and replaced it with ShowConfigOption() which does an
> >> elog(NOTICE) instead of returning a string.
>
> > I certainly don't like that. I want to be able to get at the
> > configuration setting without any notice going off.
>
> I agree with Peter --- better to separate the getting of the string
> from displaying it. What's the reason for collapsing them together?

I ended up thinking that GetConfigOption was a bit useless right now
since, with the redone GetPGVariable, there's currently nothing that
would use it. I can see some use for it since not all guc options have
an associated variable but still have a value (e.g.: seed,
server_encoding). How about I add GetConfigOption back in and change
ShowConfigOption to use it. display_proc hooks would return a char *;
GetConfigOption would use a variable's display_proc hook if it is
non-null instead of doing its own thing. ShowConfigOption would no
longer call a variable's display_proc hook.

> > I wouldn't use a printf format string at all.
>
> Good point. If we have to set up a checking mechanism then we should
> ask ourselves why we're bothering to use printf representation.

I was going on the fact that printf format string was on the todo and
that Tom suggested using them last February. When thinking about parsing
printf strings, I realized how not nice it would be, so I'm alright
with a new representation.

> > What I would like to get out of the configurability of floating-point
> > numbers is:
> > 1. The ability to dump them in binary or hex format for lossless
> > dump/reload. (printf("%a") does that.)
>
> On some platforms... I'd be happier with this if it were more portable...

Roll our own? %a and %A are C99 so are much less portable than most
other printf conversion specifiers.

Liam

--
Liam Stewart :: Red Hat Canada, Ltd. :: liams(at)redhat(dot)com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-01-18 17:02:31 Re: Bug in pg_dump/restore -o
Previous Message Dwayne Miller 2002-01-18 16:41:26 7.2b5 notes

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2002-01-18 17:19:59 Re: [PATCHES] guc
Previous Message Tom Lane 2002-01-18 16:16:22 Re: Segmentation fault of psql unset