aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/sequence.c
diff options
context:
space:
mode:
authorVadim B. Mikheev <vadim4o@yahoo.com>2000-12-03 10:27:29 +0000
committerVadim B. Mikheev <vadim4o@yahoo.com>2000-12-03 10:27:29 +0000
commit65b362fae15aba68d5cd7d4204b8224c3e1c2c07 (patch)
treea601515ed9642733b646cb5a9f0a8f0671494c50 /src/backend/commands/sequence.c
parent5e3bc5ebcddf00ba33d1483bab2a5a2d62c65120 (diff)
downloadpostgresql-65b362fae15aba68d5cd7d4204b8224c3e1c2c07.tar.gz
postgresql-65b362fae15aba68d5cd7d4204b8224c3e1c2c07.zip
Disable elog(ERROR|FATAL) in signal handlers in
critical sections of code.
Diffstat (limited to 'src/backend/commands/sequence.c')
-rw-r--r--src/backend/commands/sequence.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c
index 210657cdf06..e8944f8d98e 100644
--- a/src/backend/commands/sequence.c
+++ b/src/backend/commands/sequence.c
@@ -295,6 +295,7 @@ nextval(PG_FUNCTION_ARGS)
elm->last = result; /* last returned number */
elm->cached = last; /* last fetched number */
+ START_CRIT_CODE;
if (logit)
{
xl_seq_rec xlrec;
@@ -318,6 +319,7 @@ nextval(PG_FUNCTION_ARGS)
Assert(log >= 0);
seq->log_cnt = log; /* how much is logged */
seq->is_called = 't';
+ END_CRIT_CODE;
LockBuffer(buf, BUFFER_LOCK_UNLOCK);
@@ -386,6 +388,7 @@ do_setval(char *seqname, int32 next, bool iscalled)
elm->cached = next; /* last cached number */
/* save info in sequence relation */
+ START_CRIT_CODE;
seq->last_value = next; /* last fetched number */
seq->is_called = iscalled ? 't' : 'f';
seq->log_cnt = (iscalled) ? 0 : 1;
@@ -403,6 +406,7 @@ do_setval(char *seqname, int32 next, bool iscalled)
PageSetLSN(BufferGetPage(buf), recptr);
PageSetSUI(BufferGetPage(buf), ThisStartUpID);
}
+ END_CRIT_CODE;
LockBuffer(buf, BUFFER_LOCK_UNLOCK);