Re: our checks for read-only queries are not great - Mailing list pgsql-hackers

From Tom Lane
Subject Re: our checks for read-only queries are not great
Date
Msg-id 26872.1578515199@sss.pgh.pa.us
Whole thread Raw
In response to Re: our checks for read-only queries are not great  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: our checks for read-only queries are not great  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Jan 8, 2020 at 2:57 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> * I find COMMAND_IS_WEAKLY_READ_ONLY to be a more confusing concept
>> than what it replaces.  The test for LockStmt is an example --- the
>> comment talks about restricting locks during recovery, which is fine and
>> understandable, but then it's completely unobvious that the actual code
>> implements that behavior rather than some other one.

> Uh, suggestions?

COMMAND_NOT_IN_RECOVERY, maybe?

>> * ALTER SYSTEM SET is readonly?  Say what?

> It would be extremely lame and a huge usability regression to
> arbitrary restrict ALTER SYSTEM SET on standby nodes for no reason.

I didn't say that it shouldn't be allowed on standby nodes.  I said
it shouldn't be allowed in transactions that have explicitly declared
themselves to be read-only.  Maybe we need to disaggregate those
concepts a bit more --- a refactoring such as this would be a fine
time to do that.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: our checks for read-only queries are not great
Next
From: Robert Haas
Date:
Subject: Re: our checks for read-only queries are not great