| #!/bin/sh |
| |
| ## currently, this script makes a lot of assumptions: |
| ## in postgresql.conf.sample: |
| ## 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 '=') |
| ## in 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 |
| |
| ## Problems |
| ## 1) Don't know what to do with TRANSACTION ISOLATION LEVEL |
| |
| ## if an option is valid but shows up in only one file (guc.c but not |
| ## postgresql.conf.sample), it should be listed here so that it |
| ## can be ignored |
| INTENTIONALLY_NOT_INCLUDED="autocommit debug_deadlocks exit_on_error \ |
| is_superuser lc_collate lc_ctype lc_messages lc_monetary lc_numeric lc_time \ |
| pre_auth_delay role seed server_encoding server_version server_version_int \ |
| session_authorization trace_lock_oidmin trace_lock_table trace_locks trace_lwlocks \ |
| trace_notify trace_userlocks transaction_isolation transaction_read_only \ |
| zero_damaged_pages" |
| |
| ## PostgreSQL's check_guc should add these to its ignored list... |
| INTENTIONALLY_NOT_INCLUDED="$INTENTIONALLY_NOT_INCLUDED debug_assertions \ |
| log_btree_build_stats trace_sort wal_debug integer_datetimes \ |
| allow_system_table_mods ignore_system_indexes post_auth_delay \ |
| max_function_args max_index_keys max_identifier_length block_size \ |
| server_version_num config_file" |
| |
| ## greenplum db additions to the ignored list |
| INTENTIONALLY_NOT_INCLUDED="$INTENTIONALLY_NOT_INCLUDED geqo \ |
| gp_enable_agg_distinct gp_enable_preunique mpp_enable_explain_allstat \ |
| mpp_enable_motion_deadlock_sanity mpp_is_primary mpp_is_writer \ |
| mpp_write_shared_snapshot mpp_use_snapshop_during_callback mpp_is_callback \ |
| geqo_threshold geqo_effort geqo_pool_size geqo_generations mpp_command_count \ |
| mpp_debug_linger mpp_segment mpp_sort_flags mpp_session_id mpp_qd_proc_offset \ |
| geqo_selection_bias mpp_session_role mpp_role mpp_qd_callback_info" |
| |
| ### What options are listed in postgresql.conf.sample, but don't appear |
| ### in guc.c? |
| |
| # grab everything that looks like a setting and convert it to lower case |
| SETTINGS=`grep ' =' postgresql.conf.sample | |
| grep -v '^# ' | # strip comments |
| sed -e 's/^#//' | |
| awk '{print $1}'` |
| |
| SETTINGS=`echo "$SETTINGS" | tr 'A-Z' 'a-z'` |
| |
| for i in $SETTINGS ; do |
| hidden=0 |
| ## it sure would be nice to replace this with an sql "not in" statement |
| ## it doesn't seem to make sense to have things in .sample and not in guc.c |
| # for hidethis in $INTENTIONALLY_NOT_INCLUDED ; do |
| # if [ "$hidethis" = "$i" ] ; then |
| # hidden=1 |
| # fi |
| # done |
| if [ "$hidden" -eq 0 ] ; then |
| grep -i '"'$i'"' guc.c > /dev/null |
| if [ $? -ne 0 ] ; then |
| echo "$i seems to be missing from guc.c"; |
| fi; |
| fi |
| done |
| |
| ### What options are listed in guc.c, but don't appear |
| ### in postgresql.conf.sample? |
| |
| # grab everything that looks like a setting and convert it to lower case |
| |
| SETTINGS=`grep '{.* PGC_' guc.c | awk '{print $1}' | \ |
| sed -e 's/{//g' -e 's/"//g' -e 's/,//'` |
| |
| SETTINGS=`echo "$SETTINGS" | tr 'A-Z' 'a-z'` |
| |
| 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 |
| if [ "$hidethis" = "$i" ] ; then |
| hidden=1 |
| fi |
| done |
| if [ "$hidden" -eq 0 ] ; then |
| grep -i '#'$i' ' postgresql.conf.sample > /dev/null |
| if [ $? -ne 0 ] ; then |
| echo "$i seems to be missing from postgresql.conf.sample"; |
| fi |
| fi |
| done |