2002-08-27 04:52:42 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
## currently, this script makes a lot of assumptions:
|
2002-08-27 05:01:13 +02:00
|
|
|
## 1) the valid config settings may be preceded by a '#', but NOT '# '
|
|
|
|
## (we use this to skip comments)
|
|
|
|
## 2) the valid config settings will be followed immediately by ' ='
|
|
|
|
## (at least one space preceding the '=' for guc.c)
|
|
|
|
## 3) the options have PGC_ on the same line as the option
|
|
|
|
## 4) the options have '{ ' on the same line as the option
|
2002-08-27 04:52:42 +02:00
|
|
|
|
|
|
|
## Problems
|
|
|
|
## 1) Don't know what to do with TRANSACTION ISOLATION LEVEL
|
|
|
|
|
2002-08-27 05:02:31 +02:00
|
|
|
## if an option is valid but shows up in only one file (guc.c or
|
2002-08-27 04:52:42 +02:00
|
|
|
## postgresql.conf.sample, it should be listed here so that it
|
|
|
|
## can be ignored
|
|
|
|
INTENTIONALLY_NOT_INCLUDED="pre_auth_delay lc_messages lc_monetary \
|
2002-08-27 05:06:16 +02:00
|
|
|
lc_time lc_numeric fixbtree server_encoding session_authorization"
|
2002-08-27 04:52:42 +02:00
|
|
|
|
|
|
|
### What options are listed in postgresql.conf.sample, but don't appear
|
2002-08-27 05:02:31 +02:00
|
|
|
### in guc.c?
|
2002-08-27 04:52:42 +02:00
|
|
|
|
|
|
|
# grab everything that looks like a setting and convert it to lower case
|
2002-08-27 05:01:13 +02:00
|
|
|
SETTINGS=`grep ' =' postgresql.conf.sample |
|
|
|
|
grep -v '^# ' | # strip comments
|
|
|
|
sed -e 's/^#//' |
|
|
|
|
awk '{print $1}'`
|
|
|
|
|
|
|
|
SETTINGS=`echo "$SETTINGS" |
|
|
|
|
tr 'A-Z' 'a-z' # lowercase`
|
2002-08-27 04:52:42 +02:00
|
|
|
|
|
|
|
for i in $SETTINGS ; do
|
|
|
|
hidden=0
|
|
|
|
## it sure would be nice to replace this with an sql "not in" statement
|
|
|
|
for hidethis in $INTENTIONALLY_NOT_INCLUDED ; do
|
2002-08-27 05:01:13 +02:00
|
|
|
if [ "$hidethis" = "$i" ] ; then
|
2002-08-27 04:52:42 +02:00
|
|
|
hidden=1
|
|
|
|
fi
|
|
|
|
done
|
2002-08-27 05:01:13 +02:00
|
|
|
if [ "$hidden" -eq 0 ] ; then
|
|
|
|
grep -i $i guc.c > /dev/null
|
|
|
|
if [ $? -ne 0 ] ; then
|
2002-08-27 04:52:42 +02:00
|
|
|
echo "$i seems to be missing from guc.c";
|
|
|
|
fi;
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2002-08-27 05:02:31 +02:00
|
|
|
### What options are listed in guc.c, but don't appear
|
2002-08-27 04:52:42 +02:00
|
|
|
### in postgresql.conf.sample?
|
|
|
|
|
|
|
|
# grab everything that looks like a setting and convert it to lower case
|
|
|
|
|
2002-08-27 04:54:39 +02:00
|
|
|
SETTINGS=`grep '{ .*PGC_' guc.c | awk '{print $2}' | \
|
2002-08-27 04:52:42 +02:00
|
|
|
sed -e 's/"//g' -e 's/,//'`
|
|
|
|
SETTINGS=`echo "$SETTINGS" | tr 'A-Z' 'a-z'`
|
|
|
|
|
|
|
|
for i in $SETTINGS ; do
|
|
|
|
hidden=0
|
|
|
|
for hidethis in $INTENTIONALLY_NOT_INCLUDED ; do
|
2002-08-27 05:01:13 +02:00
|
|
|
if [ "$hidethis" = "$i" ] ; then
|
2002-08-27 04:52:42 +02:00
|
|
|
hidden=1
|
|
|
|
fi
|
|
|
|
done
|
2002-08-27 05:01:13 +02:00
|
|
|
if [ "$hidden" -eq 0 ] ; then
|
|
|
|
grep -i $i postgresql.conf.sample > /dev/null
|
|
|
|
if [ $? -ne 0 ] ; then
|
2002-08-27 04:52:42 +02:00
|
|
|
echo "$i seems to be missing from postgresql.conf.sample";
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|