Re: BUG #16988: Spurious "SET LOCAL can only be used in transaction blocks" warning using implicit transaction block - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #16988: Spurious "SET LOCAL can only be used in transaction blocks" warning using implicit transaction block
Date
Msg-id 3493686.1619912155@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #16988: Spurious "SET LOCAL can only be used in transaction blocks" warning using implicit transaction block  (Brar Piening <brar@gmx.de>)
Responses Re: BUG #16988: Spurious "SET LOCAL can only be used in transaction blocks" warning using implicit transaction block  (Brar Piening <brar@gmx.de>)
List pgsql-bugs
Brar Piening <brar@gmx.de> writes:
> Tom Lane wrote:
>> PG Bug reporting form <noreply@postgresql.org> writes:
>>> I am using SET LOCAL in an Npgsql multi-statement command.

>> It seems that whatever Npgsql is doing at the wire protocol level
>> doesn't match this, but they'd have to explain what they are doing
>> for us to offer much help.

> At the wire protocol level npgsql sends this as two queries via the
> extended query protocol without a sync inbetween them.
> (Parse,Bind,Describe,Execute;Parse,Bind,Describe,Execute,Sync)

There is no implicit transaction block around the two commands in such
a case, so that explains why it doesn't act as Mike was hoping.

Omitting the Sync has zero effect on transactional semantics; it only
means that if the first command fails, we'll skip the second one.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Brar Piening
Date:
Subject: Re: BUG #16988: Spurious "SET LOCAL can only be used in transaction blocks" warning using implicit transaction block
Next
From: Brar Piening
Date:
Subject: Re: BUG #16988: Spurious "SET LOCAL can only be used in transaction blocks" warning using implicit transaction block