Re: SET CONSTRAINTS ALL IMMEDIATE affects SET TRANSACTION READ ONLY - Mailing list pgsql-docs

From Tom Lane
Subject Re: SET CONSTRAINTS ALL IMMEDIATE affects SET TRANSACTION READ ONLY
Date
Msg-id 23996.1476147551@sss.pgh.pa.us
Whole thread Raw
In response to Re: SET CONSTRAINTS ALL IMMEDIATE affects SET TRANSACTION READ ONLY  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: SET CONSTRAINTS ALL IMMEDIATE affects SET TRANSACTION READ ONLY
List pgsql-docs
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> On 9/9/16 12:39 PM, Tom Lane wrote:
>> I wouldn't really imagine that it's sensible to set READ ONLY
>> mid-transaction at all, but if it means anything to do that, surely
>> it ought to mean that no updates can happen *after* you set it.

> I think there is a bit of code missing in check_transaction_read_only().
>  We prevent changing from read-only to read-write after the first query
> but not vice versa.  That seems like an oversight.

The comments around the code make it absolutely clear that it's
intentional, not an "oversight".  Whether it's a good idea is open
for discussion, certainly, but I don't see how you can imagine that
it wasn't considered.

            regards, tom lane


pgsql-docs by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: SET CONSTRAINTS ALL IMMEDIATE affects SET TRANSACTION READ ONLY
Next
From: dpakalnis@gmail.com
Date:
Subject: Change parameters list