pgsql: Disallow SELECT FOR UPDATE/SHARE on sequences.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Disallow SELECT FOR UPDATE/SHARE on sequences.
Дата
Msg-id E1QSCvE-0005XZ-Jj@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Disallow SELECT FOR UPDATE/SHARE on sequences.

We can't allow this because such an operation stores its transaction XID
into the sequence tuple's xmax.  Because VACUUM doesn't process sequences
(and we don't want it to start doing so), such an xmax value won't get
frozen, meaning it will eventually refer to nonexistent pg_clog storage,
and even wrap around completely.  Since the row lock is ignored by nextval
and setval, the usefulness of the operation is highly debatable anyway.
Per reports of trouble with pgpool 3.0, which had ill-advisedly started
using such commands as a form of locking.

In HEAD, also disallow SELECT FOR UPDATE/SHARE on toast tables.  Although
this does work safely given the current implementation, there seems no
good reason to allow it.  I refrained from changing that behavior in
back branches, however.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/c117838597b1a28f6f0feb4a41adff1a7e5e0bc9

Modified Files
--------------
src/backend/executor/execMain.c |   39 +++++++++++++++++++++++++++++++++++++++
1 files changed, 39 insertions(+), 0 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: pgsql: Fix vim-induced typo.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Disallow SELECT FOR UPDATE/SHARE on sequences.