Re: [COMMITTERS] pgsql: Fix document bug regarding read only transactions. - Mailing list pgsql-committers

From Tom Lane
Subject Re: [COMMITTERS] pgsql: Fix document bug regarding read only transactions.
Date
Msg-id 24379.1497489711@sss.pgh.pa.us
Whole thread Raw
In response to [COMMITTERS] pgsql: Fix document bug regarding read only transactions.  (Tatsuo Ishii <ishii@postgresql.org>)
Responses Re: [COMMITTERS] pgsql: Fix document bug regarding read onlytransactions.  (Tatsuo Ishii <ishii@sraoss.co.jp>)
List pgsql-committers
Tatsuo Ishii <ishii@postgresql.org> writes:
> Fix document bug regarding read only transactions.
> It was explained that read only transactions (not in standby) allow to
> update sequences. This had been wrong since the commit:
> 05d8a561ff85db1545f5768fe8d8dc9d99ad2ef7

This new text is not any more accurate than the old, it's just wrong
in the other direction.  The actual behavior is still what's stated
in the commit message for that commit: read-only transactions on the
master are allowed to do nextval() on temp sequences but not permanent
ones.

regression=# create temp sequence s1;
CREATE SEQUENCE
regression=# create sequence s2;
CREATE SEQUENCE
regression=# begin transaction read only;
BEGIN
regression=# select nextval('s1');
 nextval
---------
       1
(1 row)

regression=# select nextval('s2');
ERROR:  cannot execute nextval() in a read-only transaction


I think the correct fix would have been to change "update sequences"
to "update temporary sequences", not to remove it.

            regards, tom lane


pgsql-committers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: [COMMITTERS] pgsql: Fix document bug regarding read only transactions.
Next
From: Tatsuo Ishii
Date:
Subject: Re: [COMMITTERS] pgsql: Fix document bug regarding read onlytransactions.