guc.c and postgresql.conf.sample constistency checker

Lists: pgsql-patches
From: snyder(at)roguewave(dot)com
To: pgsql-patches(at)postgresql(dot)org
Subject: guc.c and postgresql.conf.sample constistency checker
Date: 2002-06-07 05:18:06
Message-ID: 20020606221806.A13922@snyder.dnsalias.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

This is a small script to check that guc.c and postgresql.conf.sample
are fairly representative of each other, and the output that I'm getting
against the most recent cvs.

The fix for debug_level is easy enough (I know it was removed from guc.c),
but I don't know enough about the rest of the items to be able to document
them in the postgresql.conf.sample well.

output:
debug_level seems to be missing from guc.c
fixbtree seems to be missing from postgresql.conf.sample
pre_auth_delay seems to be missing from postgresql.conf.sample
lc_messages seems to be missing from postgresql.conf.sample
lc_monetary seems to be missing from postgresql.conf.sample
lc_numeric seems to be missing from postgresql.conf.sample
lc_time seems to be missing from postgresql.conf.sample
server_encoding seems to be missing from postgresql.conf.sample
session_authorization seems to be missing from postgresql.conf.sample

I believe this script should live in src/tools
#!/bin/sh

## currently, this script makes a lot of assumptions:
## 1) location of guc.c and postgresql.conf.sample relative to src/tools
## For postgresql.conf.sample
## 2) the valid config settings may be preceded by a '#', but NOT '# '
## 3) the valid config settings will be followed immediately by ' ='
## (at least one space preceding the '='
## For guc.c
## 4) the options have PGC_ on the same line as the option
## 5) the options have '{ ' on the same line as the option

## Problems
## 1) Don't know what to do with TRANSACTION ISOLATION LEVEL (in guc.c)

PATH_TO_GUC="`dirname $0`/../backend/utils/misc"

SETTINGS=`grep ' =' $PATH_TO_GUC/postgresql.conf.sample | grep -v '^# ' | sed -e 's,^#,,' | awk '{print $1}'`
for i in $SETTINGS ; do
grep -i $i $PATH_TO_GUC/guc.c > /dev/null;
if [ ! $? = 0 ] ; then
echo "$i seems to be missing from guc.c";
fi;
done

SETTINGS=`grep '{ .*PGC_' $PATH_TO_GUC/guc.c | awk '{print $2}' | sed -e 's,",,g' -e 's/,//'`
for i in $SETTINGS ; do
grep -i $i $PATH_TO_GUC/postgresql.conf.sample > /dev/null;
if [ ! $? = 0 ] ; then
echo "$i seems to be missing from postgresql.conf.sample";
fi;
done


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: snyder(at)roguewave(dot)com
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: guc.c and postgresql.conf.sample constistency checker
Date: 2002-06-07 22:26:52
Message-ID: Pine.LNX.4.44.0206072003320.935-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

snyder(at)roguewave(dot)com writes:

> This is a small script to check that guc.c and postgresql.conf.sample
> are fairly representative of each other, and the output that I'm getting
> against the most recent cvs.

The catch is that some of these options (lc_*) are supposed to be absent,
so it's not as easy as it seems.

--
Peter Eisentraut peter_e(at)gmx(dot)net


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: snyder(at)roguewave(dot)com
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: guc.c and postgresql.conf.sample constistency checker
Date: 2002-06-14 04:50:52
Message-ID: 200206140450.g5E4oqZ01177@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
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.

---------------------------------------------------------------------------

snyder(at)roguewave(dot)com wrote:
> This is a small script to check that guc.c and postgresql.conf.sample
> are fairly representative of each other, and the output that I'm getting
> against the most recent cvs.
>
> The fix for debug_level is easy enough (I know it was removed from guc.c),
> but I don't know enough about the rest of the items to be able to document
> them in the postgresql.conf.sample well.
>
> output:
> debug_level seems to be missing from guc.c
> fixbtree seems to be missing from postgresql.conf.sample
> pre_auth_delay seems to be missing from postgresql.conf.sample
> lc_messages seems to be missing from postgresql.conf.sample
> lc_monetary seems to be missing from postgresql.conf.sample
> lc_numeric seems to be missing from postgresql.conf.sample
> lc_time seems to be missing from postgresql.conf.sample
> server_encoding seems to be missing from postgresql.conf.sample
> session_authorization seems to be missing from postgresql.conf.sample
>
> I believe this script should live in src/tools
> #!/bin/sh
>
> ## currently, this script makes a lot of assumptions:
> ## 1) location of guc.c and postgresql.conf.sample relative to src/tools
> ## For postgresql.conf.sample
> ## 2) the valid config settings may be preceded by a '#', but NOT '# '
> ## 3) the valid config settings will be followed immediately by ' ='
> ## (at least one space preceding the '='
> ## For guc.c
> ## 4) the options have PGC_ on the same line as the option
> ## 5) the options have '{ ' on the same line as the option
>
> ## Problems
> ## 1) Don't know what to do with TRANSACTION ISOLATION LEVEL (in guc.c)
>
> PATH_TO_GUC="`dirname $0`/../backend/utils/misc"
>
> SETTINGS=`grep ' =' $PATH_TO_GUC/postgresql.conf.sample | grep -v '^# ' | sed -e 's,^#,,' | awk '{print $1}'`
> for i in $SETTINGS ; do
> grep -i $i $PATH_TO_GUC/guc.c > /dev/null;
> if [ ! $? = 0 ] ; then
> echo "$i seems to be missing from guc.c";
> fi;
> done
>
> SETTINGS=`grep '{ .*PGC_' $PATH_TO_GUC/guc.c | awk '{print $2}' | sed -e 's,",,g' -e 's/,//'`
> for i in $SETTINGS ; do
> grep -i $i $PATH_TO_GUC/postgresql.conf.sample > /dev/null;
> if [ ! $? = 0 ] ; then
> echo "$i seems to be missing from postgresql.conf.sample";
> fi;
> done
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: snyder(at)roguewave(dot)com, pgsql-patches(at)postgresql(dot)org
Subject: Re: guc.c and postgresql.conf.sample constistency checker
Date: 2002-06-14 05:27:34
Message-ID: 3453.1024032454@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> 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.

See subsequent objections from Peter and me. We could use something
like this, but it needs to be smarter.

regards, tom lane


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: snyder(at)roguewave(dot)com, pgsql-patches(at)postgresql(dot)org
Subject: Re: guc.c and postgresql.conf.sample constistency checker
Date: 2002-06-14 16:26:58
Message-ID: 200206141626.g5EGQwU06718@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > 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.
>
> See subsequent objections from Peter and me. We could use something
> like this, but it needs to be smarter.

Sorry I missed the objections. I will not apply the script.

What about the comments he makes about the missing postgresql.conf
entries. Do those need fixing?

debug_level seems to be missing from guc.c
fixbtree seems to be missing from postgresql.conf.sample
pre_auth_delay seems to be missing from postgresql.conf.sample
lc_messages seems to be missing from postgresql.conf.sample
lc_monetary seems to be missing from postgresql.conf.sample
lc_numeric seems to be missing from postgresql.conf.sample
lc_time seems to be missing from postgresql.conf.sample
server_encoding seems to be missing from postgresql.conf.sample
session_authorization seems to be missing from postgresql.conf.sample

debug_level is removed from postgresql.conf already, replaced by
client/server_min_messages.

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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: snyder(at)roguewave(dot)com, pgsql-patches(at)postgresql(dot)org
Subject: Re: guc.c and postgresql.conf.sample constistency checker
Date: 2002-06-14 16:57:35
Message-ID: 7251.1024073855@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> What about the comments he makes about the missing postgresql.conf
> entries. Do those need fixing?

No (with the exception of debug_level which you got already).

regards, tom lane