Skip to content

Commit 9dd0807

Browse files
committed
reset 'partid' in create_partitions_internal() in case of error
1 parent 36f9346 commit 9dd0807

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/pathman_workers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ bgw_main_spawn_partitions(Datum main_arg)
365365
args->value_type);
366366

367367
/* Finish transaction in an appropriate way */
368-
if (args->result == InvalidOid || IsAbortedTransactionBlockState())
368+
if (args->result == InvalidOid)
369369
AbortCurrentTransaction();
370370
else
371371
CommitTransactionCommand();

src/pg_pathman.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,9 @@ create_partitions_internal(Oid relid, Datum value, Oid value_type)
902902
FreeErrorData(edata);
903903

904904
SPI_finish(); /* no problem if not connected */
905+
906+
/* Reset 'partid' in case of error */
907+
partid = InvalidOid;
905908
}
906909
PG_END_TRY();
907910

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy