11#! /bin/sh
22
33# # 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 '='
9- # # For guc.c
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
4+ # # 1) the valid config settings may be preceded by a '#', but NOT '# '
5+ # # (we use this to skip comments)
6+ # # 2) the valid config settings will be followed immediately by ' ='
7+ # # (at least one space preceding the '=' for guc.c)
8+ # # 3) the options have PGC_ on the same line as the option
9+ # # 4) the options have '{ ' on the same line as the option
1210
1311# # Problems
1412# # 1) Don't know what to do with TRANSACTION ISOLATION LEVEL
@@ -23,21 +21,25 @@ lc_time lc_numeric fixbtree"
2321# ## in guc.h?
2422
2523# grab everything that looks like a setting and convert it to lower case
26- SETTINGS=` grep' =' postgresql.conf.sample| grep -v' ^#' | \
27- sed -e' s/^#//' | awk' {print $1}' `
28- SETTINGS=` echo" $SETTINGS " | tr' A-Z' ' a-z' `
24+ SETTINGS=` grep' =' postgresql.conf.sample|
25+ grep -v' ^#' | # strip comments
26+ sed -e 's/^#//' |
27+ awk '{print $1}' `
28+
29+ SETTINGS=` echo" $SETTINGS " |
30+ tr' A-Z' ' a-z' # lowercase`
2931
3032for i in $SETTINGS ; do
3133 hidden=0
3234# # it sure would be nice to replace this with an sql "not in" statement
3335for hidethis in $INTENTIONALLY_NOT_INCLUDED ; do
34- if [" $i " = " $hidethis " ]; then
36+ if [" $hidethis " = " $i " ]; then
3537 hidden=1
3638fi
3739done
38- if [" 0 " = " $hidden " ]; then
39- grep -i$i guc.c> /dev/null;
40- if [! $? = 0 ]; then
40+ if [" $hidden " -eq 0 ]; then
41+ grep -i$i guc.c> /dev/null
42+ if [$? -ne 0 ]; then
4143echo " $i seems to be missing from guc.c" ;
4244fi ;
4345fi
@@ -55,13 +57,13 @@ SETTINGS=`echo "$SETTINGS" | tr 'A-Z' 'a-z'`
5557for i in $SETTINGS ; do
5658 hidden=0
5759for hidethis in $INTENTIONALLY_NOT_INCLUDED ; do
58- if [" $i " = " $hidethis " ]; then
60+ if [" $hidethis " = " $i " ]; then
5961 hidden=1
6062fi
6163done
62- if [" 0 " = " $hidden " ]; then
63- grep -i$i postgresql.conf.sample> /dev/null;
64- if [! $? = 0 ]; then
64+ if [" $hidden " -eq 0 ]; then
65+ grep -i$i postgresql.conf.sample> /dev/null
66+ if [$? -ne 0 ]; then
6567echo " $i seems to be missing from postgresql.conf.sample" ;
6668fi
6769fi