diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index 18dd9fe4a4..131a670b59 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -1,5 +1,5 @@ @@ -1476,6 +1476,25 @@ SET ENABLE_SEQSCAN TO OFF; + + + read-only transaction + + + DEFAULT_TRANSACTION_READ_ONLY (boolean) + + + A read-only SQL transaction cannot alter non-temporary tables. + This parameter controls the default read-only status of each new + transaction. The default is false (read/write). + + + + Consult for more information. + + + + DYNAMIC_LIBRARY_PATH (string) dynamic_library_path @@ -2182,11 +2201,13 @@ dynamic_library_path = '/usr/local/lib/postgresql:/home/my_project/lib:$libdir' PostgreSQL to report an error, aborting the current transaction. Setting zero_damaged_pages to true causes the system to instead report a warning, zero out the damaged page, - and continue processing. This behavior will lose data, + and continue processing. This behavior will destroy data, namely all the rows on the damaged page. But it allows you to get past the error and retrieve rows from any undamaged pages that may be present in the table. So it is useful for recovering data if - corruption has occurred due to hardware or software error. The + corruption has occurred due to hardware or software error. You should + generally not set this true until you have given up hope of recovering + data from the damaged page(s) of a table. The default setting is off, and it can only be changed by a superuser. diff --git a/src/backend/utils/misc/check_guc b/src/backend/utils/misc/check_guc index 0268396c74..7930d06f6e 100755 --- a/src/backend/utils/misc/check_guc +++ b/src/backend/utils/misc/check_guc @@ -1,21 +1,24 @@ #!/bin/sh ## currently, this script makes a lot of assumptions: -## 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 +## 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 or -## postgresql.conf.sample, it should be listed here so that it +## 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="pre_auth_delay lc_messages lc_monetary \ -lc_time lc_numeric server_encoding session_authorization" +lc_numeric lc_time seed server_encoding session_authorization \ +transaction_isolation transaction_read_only zero_damaged_pages" ### What options are listed in postgresql.conf.sample, but don't appear ### in guc.c? @@ -26,19 +29,19 @@ grep -v '^# ' | # strip comments sed -e 's/^#//' | awk '{print $1}'` -SETTINGS=`echo "$SETTINGS" | -tr 'A-Z' 'a-z' # lowercase` +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 + ## 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 + grep -i '"'$i'"' guc.c > /dev/null if [ $? -ne 0 ] ; then echo "$i seems to be missing from guc.c"; fi; @@ -50,19 +53,21 @@ done # grab everything that looks like a setting and convert it to lower case -SETTINGS=`grep '{ .*PGC_' guc.c | awk '{print $2}' | \ - sed -e 's/"//g' -e 's/,//'` +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 + grep -i '#'$i' ' postgresql.conf.sample > /dev/null if [ $? -ne 0 ] ; then echo "$i seems to be missing from postgresql.conf.sample"; fi diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index 7039a7572a..f32aa3ff4c 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -205,6 +205,7 @@ #authentication_timeout = 60 # 1-600, in seconds #deadlock_timeout = 1000 # in milliseconds #default_transaction_isolation = 'read committed' +#default_transaction_read_only = false #extra_float_digits = 0 # min -15, max 2 #max_expr_depth = 10000 # min 10 #max_files_per_process = 1000 # min 25 @@ -213,6 +214,5 @@ #sql_inheritance = true #transform_null_equals = false #statement_timeout = 0 # 0 is disabled, in milliseconds -#zero_damaged_pages = false # set this true only for disaster recovery #db_user_namespace = false #preload_libraries = ''