1
1
#! /bin/sh
2
2
3
3
# # currently, this script makes a lot of assumptions:
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
4
+ # # in postgresql.conf.sample:
5
+ # # 1) the valid config settings may be preceded by a '#', but NOT '# '
6
+ # # (we use this to skip comments)
7
+ # # 2) the valid config settings will be followed immediately by ' ='
8
+ # # (at least one space preceding the '=')
9
+ # # in guc.c:
10
+ # # 3) the options have PGC_ on the same line as the option
11
+ # # 4) the options have '{' on the same line as the option
10
12
11
13
# # Problems
12
14
# # 1) Don't know what to do with TRANSACTION ISOLATION LEVEL
13
15
14
- # # if an option is valid but shows up in only one file (guc.c or
15
- # # postgresql.conf.sample, it should be listed here so that it
16
+ # # if an option is valid but shows up in only one file (guc.c but not
17
+ # # postgresql.conf.sample) , it should be listed here so that it
16
18
# # can be ignored
17
19
INTENTIONALLY_NOT_INCLUDED=" pre_auth_delay lc_messages lc_monetary \
18
- lc_time lc_numeric server_encoding session_authorization"
20
+ lc_numeric lc_time seed server_encoding session_authorization \
21
+ transaction_isolation transaction_read_only zero_damaged_pages"
19
22
20
23
# ## What options are listed in postgresql.conf.sample, but don't appear
21
24
# ## in guc.c?
@@ -26,19 +29,19 @@ grep -v '^# ' | # strip comments
26
29
sed -e 's/^#//' |
27
30
awk '{print $1}' `
28
31
29
- SETTINGS=` echo " $SETTINGS " |
30
- tr ' A-Z' ' a-z' # lowercase`
32
+ SETTINGS=` echo " $SETTINGS " | tr ' A-Z' ' a-z' `
31
33
32
34
for i in $SETTINGS ; do
33
35
hidden=0
34
36
# # it sure would be nice to replace this with an sql "not in" statement
35
- for hidethis in $INTENTIONALLY_NOT_INCLUDED ; do
36
- if [ " $hidethis " = " $i " ] ; then
37
- hidden=1
38
- fi
39
- done
37
+ # # it doesn't seem to make sense to have things in .sample and not in guc.c
38
+ # for hidethis in $INTENTIONALLY_NOT_INCLUDED ; do
39
+ # if [ "$hidethis" = "$i" ] ; then
40
+ # hidden=1
41
+ # fi
42
+ # done
40
43
if [ " $hidden " -eq 0 ] ; then
41
- grep -i $i guc.c > /dev/null
44
+ grep -i ' " ' $i ' " ' guc.c > /dev/null
42
45
if [ $? -ne 0 ] ; then
43
46
echo " $i seems to be missing from guc.c" ;
44
47
fi ;
50
53
51
54
# grab everything that looks like a setting and convert it to lower case
52
55
53
- SETTINGS=` grep ' { .*PGC_' guc.c | awk ' {print $2}' | \
54
- sed -e ' s/"//g' -e ' s/,//' `
56
+ SETTINGS=` grep ' {.* PGC_' guc.c | awk ' {print $1}' | \
57
+ sed -e ' s/{//g' -e ' s/"//g' -e ' s/,//' `
58
+
55
59
SETTINGS=` echo " $SETTINGS " | tr ' A-Z' ' a-z' `
56
60
57
61
for i in $SETTINGS ; do
58
62
hidden=0
63
+ # # it sure would be nice to replace this with an sql "not in" statement
59
64
for hidethis in $INTENTIONALLY_NOT_INCLUDED ; do
60
65
if [ " $hidethis " = " $i " ] ; then
61
66
hidden=1
62
67
fi
63
68
done
64
69
if [ " $hidden " -eq 0 ] ; then
65
- grep -i $i postgresql.conf.sample > /dev/null
70
+ grep -i ' # ' $i ' ' postgresql.conf.sample > /dev/null
66
71
if [ $? -ne 0 ] ; then
67
72
echo " $i seems to be missing from postgresql.conf.sample" ;
68
73
fi
0 commit comments