mirror of
https://github.com/postgres/postgres.git
synced 2025-05-06 19:59:18 +03:00
Forbid setval() during recovery. This prevents the PANIC reported by
Erik Rijkers. Patch by Andres Freund.
This commit is contained in:
parent
2f6b4560af
commit
94f610b163
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.166 2010/02/14 18:42:14 rhaas Exp $
|
* $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.167 2010/02/19 06:29:19 heikki Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -736,6 +736,9 @@ do_setval(Oid relid, int64 next, bool iscalled)
|
|||||||
Buffer buf;
|
Buffer buf;
|
||||||
Form_pg_sequence seq;
|
Form_pg_sequence seq;
|
||||||
|
|
||||||
|
/* setval() writes to database and must be prevented during recovery */
|
||||||
|
PreventCommandDuringRecovery();
|
||||||
|
|
||||||
/* open and AccessShareLock sequence */
|
/* open and AccessShareLock sequence */
|
||||||
init_sequence(relid, &elm, &seqrel);
|
init_sequence(relid, &elm, &seqrel);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user