Check whether the function call is in transaction block

velioglu/tmpfuncprop
Burak Velioglu 2022-02-10 00:04:51 +03:00
parent 5c74514600
commit 8901936e9a
No known key found for this signature in database
GPG Key ID: F6827E620F6549C6
1 changed files with 6 additions and 0 deletions

View File

@ -1169,6 +1169,12 @@ GetAggregateDDLCommand(const RegProcedure funcOid, bool useCreateOrReplace)
static void
EnsureSequentialModeForFunctionDDL(void)
{
if (!IsTransactionBlock())
{
/* we do not need to switch to sequential mode if we are not in a transaction */
return;
}
if (ParallelQueryExecutedInTransaction())
{
ereport(ERROR, (errmsg("cannot create function because there was a "