1
1
#! /bin/sh
2
2
3
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 '='
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
12
10
13
11
# # Problems
14
12
# # 1) Don't know what to do with TRANSACTION ISOLATION LEVEL
@@ -23,21 +21,25 @@ lc_time lc_numeric fixbtree"
23
21
# ## in guc.h?
24
22
25
23
# 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`
29
31
30
32
for i in $SETTINGS ; do
31
33
hidden=0
32
34
# # it sure would be nice to replace this with an sql "not in" statement
33
35
for hidethis in $INTENTIONALLY_NOT_INCLUDED ; do
34
- if [ " $i " = " $hidethis " ] ; then
36
+ if [ " $hidethis " = " $i " ] ; then
35
37
hidden=1
36
38
fi
37
39
done
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
41
43
echo " $i seems to be missing from guc.c" ;
42
44
fi ;
43
45
fi
@@ -55,13 +57,13 @@ SETTINGS=`echo "$SETTINGS" | tr 'A-Z' 'a-z'`
55
57
for i in $SETTINGS ; do
56
58
hidden=0
57
59
for hidethis in $INTENTIONALLY_NOT_INCLUDED ; do
58
- if [ " $i " = " $hidethis " ] ; then
60
+ if [ " $hidethis " = " $i " ] ; then
59
61
hidden=1
60
62
fi
61
63
done
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
65
67
echo " $i seems to be missing from postgresql.conf.sample" ;
66
68
fi
67
69
fi
0 commit comments