3 ## currently, this script makes a lot of assumptions:
4 ## 1) location of guc.c and postgresql.conf.sample relative to script
5 ## For postgresql.conf.sample
6 ## 2) the valid config settings may be preceded by a '#', but NOT '# '
7 ## 3) the valid config settings will be followed immediately by ' ='
8 ## (at least one space preceding the '='
10 ## 4) the options have PGC_ on the same line as the option
11 ## 5) the options have '{ ' on the same line as the option
14 ## 1) Don't know what to do with TRANSACTION ISOLATION LEVEL
16 ## if an option is valid but shows up in only one file (guc.h or
17 ## postgresql.conf.sample, it should be listed here so that it
19 INTENTIONALLY_NOT_INCLUDED="pre_auth_delay lc_messages lc_monetary \
20 lc_time lc_numeric fixbtree"
22 #self_path stolen from pg_ctl
23 self_path=`echo "$0" | sed 's,/[^/]*$,,'` # (dirname command is not portable)
24 PATH_TO_GUC="$self_path"
26 ### What options are listed in postgresql.conf.sample, but don't appear
29 # grab everything that looks like a setting and convert it to lower case
30 SETTINGS=`grep ' =' $PATH_TO_GUC/postgresql.conf.sample | grep -v '^# ' | \
31 sed -e 's/^#//' | awk '{print $1}'`
32 SETTINGS=`echo "$SETTINGS" | tr 'A-Z' 'a-z'`
34 for i in $SETTINGS ; do
36 ## it sure would be nice to replace this with an sql "not in" statement
37 for hidethis in $INTENTIONALLY_NOT_INCLUDED ; do
38 if [ "$i" = "$hidethis" ] ; then
42 if [ "0" = "$hidden" ] ; then
43 grep -i $i $PATH_TO_GUC/guc.c > /dev/null;
44 if [ ! $? = 0 ] ; then
45 echo "$i seems to be missing from guc.c";
50 ### What options are listed in guc.h, but don't appear
51 ### in postgresql.conf.sample?
53 # grab everything that looks like a setting and convert it to lower case
55 SETTINGS=`grep '{ .*PGC_' $PATH_TO_GUC/guc.c | awk '{print $2}' | \
56 sed -e 's/"//g' -e 's/,//'`
57 SETTINGS=`echo "$SETTINGS" | tr 'A-Z' 'a-z'`
59 for i in $SETTINGS ; do
61 for hidethis in $INTENTIONALLY_NOT_INCLUDED ; do
62 if [ "$i" = "$hidethis" ] ; then
66 if [ "0" = "$hidden" ] ; then
67 grep -i $i $PATH_TO_GUC/postgresql.conf.sample > /dev/null;
68 if [ ! $? = 0 ] ; then
69 echo "$i seems to be missing from postgresql.conf.sample";