File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 88 *
99 *
1010 * IDENTIFICATION
11- * $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.53 2001/04/03 21:58:00 vadim Exp $
11+ * $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.54 2001/04/04 15:43:25 vadim Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -181,13 +181,13 @@ DefineSequence(CreateSeqStmt *seq)
181181 /* Now - form & insert sequence tuple */
182182 tuple = heap_formtuple (tupDesc , value , null );
183183 heap_insert (rel , tuple );
184- ReleaseBuffer (buf );
185184
186185 /*
187186 * After crash REDO of heap_insert above would re-init page and
188187 * our magic number would be lost. We have to log sequence creation.
189188 * This means two log records instead of one -:(
190189 */
190+ LockBuffer (buf , BUFFER_LOCK_EXCLUSIVE );
191191 START_CRIT_SECTION ();
192192 {
193193 xl_seq_rec xlrec ;
@@ -217,6 +217,8 @@ DefineSequence(CreateSeqStmt *seq)
217217 }
218218 END_CRIT_SECTION ();
219219
220+ LockBuffer (buf , BUFFER_LOCK_UNLOCK );
221+ ReleaseBuffer (buf );
220222 heap_close (rel , AccessExclusiveLock );
221223}
222224
You can’t perform that action at this time.
0 commit comments