Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit fb4f5f7

Browse files
committed
Notes in Migration to v6.5 section.
1 parent 9680a71 commit fb4f5f7

File tree

2 files changed

+57
-3
lines changed

2 files changed

+57
-3
lines changed

doc/src/sgml/mvcc.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ ERROR: Can't serialize access due to concurrent update
515515
by <command>SELECT</command> it doesn't mean that this row really
516516
exists at the time it is returned (i.e. sometime after the
517517
statement or transaction began) nor
518-
that the row is protected from deletion or update by concurrent
518+
that the row is protected from deletion or updation by concurrent
519519
transactions before the current transaction does a commit or rollback.
520520
</para>
521521

doc/src/sgml/release.sgml

+56-2
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,65 @@
132132
is required for those wishing to migrate data from any
133133
previous release of <productname>Postgres</productname>.
134134
</para>
135-
</sect2>
135+
136+
<para>
137+
138+
Because readers in 6.5 don't lock data, regardless of transaction
139+
isolation level, data read by one transaction can be overwritten by
140+
another. In the other words, if a row is returned by
141+
<command>SELECT</command> it doesn't mean that this row really exists
142+
at the time it is returned (i.e. sometime after the statement or
143+
transaction began) nor that the row is protected from deletion or
144+
updation by concurrent transactions before the current transaction does
145+
a commit or rollback.
146+
147+
</para>
148+
149+
<para>
150+
151+
To ensure the actual existance of a row and protect it against
152+
concurrent updates one must use <command>SELECT FOR UPDATE</command> or
153+
an appropriate <command>LOCK TABLE</command> statement. This should be
154+
taken into account when porting applications from previous releases of
155+
<productname>Postgres</productname> and other environments.
156+
157+
</para>
158+
159+
<para>
160+
161+
Keep above in mind if you are using contrib/refint.* triggers for
162+
referential integrity. Additional technics are required now. One way is
163+
to use <command>LOCK parent_table IN SHARE ROW EXCLUSIVE MODE</command>
164+
command if a transaction is going to update/delete a primary key and
165+
use <command>LOCK parent_table IN SHARE MODE</command> command if a
166+
transaction is going to update/insert a foreign key.
167+
168+
<note>
169+
<para>
170+
171+
Note that if you run a transaction in SERIALIZABLE mode then you must
172+
execute <command>LOCK</command> commands above before execution of any
173+
DML statement
174+
(<command>SELECT/INSERT/DELETE/UPDATE/FETCH/COPY_TO</command>) in the
175+
transaction.
176+
177+
</para>
178+
</note>
179+
180+
<para>
181+
182+
These inconveniences will disappear when the ability to read durty
183+
(uncommitted) data, regardless of isolation level, and true referential
184+
integrity will be implemented.
185+
186+
</para>
187+
188+
</para>
189+
190+
</sect2>
136191

137192
<sect2>
138193
<title>Detailed Change List</title>
139-
140194
<para>
141195
<programlisting>
142196
Bug Fixes

0 commit comments

Comments
 (0)