aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/sequence.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/sequence.c')
-rw-r--r--src/backend/commands/sequence.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c
index 5c2ce789468..5e1b0fe2897 100644
--- a/src/backend/commands/sequence.c
+++ b/src/backend/commands/sequence.c
@@ -1055,18 +1055,10 @@ lock_and_open_sequence(SeqTable seq)
ResourceOwner currentOwner;
currentOwner = CurrentResourceOwner;
- PG_TRY();
- {
- CurrentResourceOwner = TopTransactionResourceOwner;
- LockRelationOid(seq->relid, RowExclusiveLock);
- }
- PG_CATCH();
- {
- /* Ensure CurrentResourceOwner is restored on error */
- CurrentResourceOwner = currentOwner;
- PG_RE_THROW();
- }
- PG_END_TRY();
+ CurrentResourceOwner = TopTransactionResourceOwner;
+
+ LockRelationOid(seq->relid, RowExclusiveLock);
+
CurrentResourceOwner = currentOwner;
/* Flag that we have a lock in the current xact */