Re: pgsql: Fix document bug regarding read only transactions.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Fix document bug regarding read only transactions.
Date: 2017-06-15 01:21:51
Message-ID: 24379.1497489711@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Tatsuo Ishii <ishii(at)postgresql(dot)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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tatsuo Ishii 2017-06-15 01:41:04 Re: pgsql: Fix document bug regarding read only transactions.
Previous Message Tatsuo Ishii 2017-06-15 01:10:55 pgsql: Fix document bug regarding read only transactions.