Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita385186

Browse files
committed
Remove zero_damaged_pages from postgresql.conf.sample; the only way to
find out about it is to read the documentation that tells you howdangerous it is. Add default_transaction_read_only to documentation;seems to have been overlooked in patch that added read-only transactions.Clean up check_guc comparison script, which has been suffering bit rot.
1 parentf1fb9e0 commita385186

File tree

3 files changed

+50
-24
lines changed

3 files changed

+50
-24
lines changed

‎doc/src/sgml/runtime.sgml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.175 2003/03/28 20:17:13 tgl Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.176 2003/04/03 23:32:47 tgl Exp $
33
-->
44

55
<Chapter Id="runtime">
@@ -1476,6 +1476,25 @@ SET ENABLE_SEQSCAN TO OFF;
14761476
</listitem>
14771477
</varlistentry>
14781478

1479+
<varlistentry>
1480+
<indexterm>
1481+
<primary>read-only transaction</primary>
1482+
</indexterm>
1483+
1484+
<term><varname>DEFAULT_TRANSACTION_READ_ONLY</varname> (<type>boolean</type>)</term>
1485+
<listitem>
1486+
<para>
1487+
A read-only SQL transaction cannot alter non-temporary tables.
1488+
This parameter controls the default read-only status of each new
1489+
transaction. The default is false (read/write).
1490+
</para>
1491+
1492+
<para>
1493+
Consult <xref linkend="sql-set-transaction"> for more information.
1494+
</para>
1495+
</listitem>
1496+
</varlistentry>
1497+
14791498
<varlistentry>
14801499
<term><varname>DYNAMIC_LIBRARY_PATH</varname> (<type>string</type>)</term>
14811500
<indexterm><primary>dynamic_library_path</></>
@@ -2182,11 +2201,13 @@ dynamic_library_path = '/usr/local/lib/postgresql:/home/my_project/lib:$libdir'
21822201
<productname>PostgreSQL</> to report an error, aborting the current
21832202
transaction. Setting <varname>zero_damaged_pages</> to true causes
21842203
the system to instead report a warning, zero out the damaged page,
2185-
and continue processing. This behavior <emphasis>willlose data</>,
2204+
and continue processing. This behavior <emphasis>willdestroy data</>,
21862205
namely all the rows on the damaged page. But it allows you to get
21872206
past the error and retrieve rows from any undamaged pages that may
21882207
be present in the table. So it is useful for recovering data if
2189-
corruption has occurred due to hardware or software error. The
2208+
corruption has occurred due to hardware or software error. You should
2209+
generally not set this true until you have given up hope of recovering
2210+
data from the damaged page(s) of a table. The
21902211
default setting is off, and it can only be changed by a superuser.
21912212
</para>
21922213
</listitem>

‎src/backend/utils/misc/check_guc

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
#!/bin/sh
22

33
## 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
1012

1113
## Problems
1214
## 1) Don't know what to do with TRANSACTION ISOLATION LEVEL
1315

14-
## if an option is valid but shows up in only one file (guc.cor
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.cbut not
17+
## postgresql.conf.sample), it should be listed here so that it
1618
## can be ignored
1719
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"
1922

2023
### What options are listed in postgresql.conf.sample, but don't appear
2124
### in guc.c?
@@ -26,19 +29,19 @@ grep -v '^# ' | # strip comments
2629
sed -e 's/^#//' |
2730
awk '{print $1}'`
2831

29-
SETTINGS=`echo"$SETTINGS"|
30-
tr'A-Z''a-z'# lowercase`
32+
SETTINGS=`echo"$SETTINGS"| tr'A-Z''a-z'`
3133

3234
foriin$SETTINGS;do
3335
hidden=0
3436
## it sure would be nice to replace this with an sql "not in" statement
35-
forhidethisin$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
4043
if ["$hidden"-eq 0 ];then
41-
grep -i$i guc.c> /dev/null
44+
grep -i'"'$i'"' guc.c> /dev/null
4245
if [$?-ne 0 ];then
4346
echo"$i seems to be missing from guc.c";
4447
fi;
@@ -50,19 +53,21 @@ done
5053

5154
# grab everything that looks like a setting and convert it to lower case
5255

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+
5559
SETTINGS=`echo"$SETTINGS"| tr'A-Z''a-z'`
5660

5761
foriin$SETTINGS;do
5862
hidden=0
63+
## it sure would be nice to replace this with an sql "not in" statement
5964
forhidethisin$INTENTIONALLY_NOT_INCLUDED;do
6065
if ["$hidethis"="$i" ];then
6166
hidden=1
6267
fi
6368
done
6469
if ["$hidden"-eq 0 ];then
65-
grep -i$i postgresql.conf.sample> /dev/null
70+
grep -i'#'$i'' postgresql.conf.sample> /dev/null
6671
if [$?-ne 0 ];then
6772
echo"$i seems to be missing from postgresql.conf.sample";
6873
fi

‎src/backend/utils/misc/postgresql.conf.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@
205205
#authentication_timeout = 60# 1-600, in seconds
206206
#deadlock_timeout = 1000# in milliseconds
207207
#default_transaction_isolation = 'read committed'
208+
#default_transaction_read_only = false
208209
#extra_float_digits = 0# min -15, max 2
209210
#max_expr_depth = 10000# min 10
210211
#max_files_per_process = 1000# min 25
@@ -213,6 +214,5 @@
213214
#sql_inheritance = true
214215
#transform_null_equals = false
215216
#statement_timeout = 0# 0 is disabled, in milliseconds
216-
#zero_damaged_pages = false # set this true only for disaster recovery
217217
#db_user_namespace = false
218218
#preload_libraries = ''

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp