Re: Некорректное пояснение к примеру в разделе 13.2.1 - Mailing list pgsql-docs

From Pavel Luzanov
Subject Re: Некорректное пояснение к примеру в разделе 13.2.1
Date
Msg-id 4b95bfe2-e1e3-0716-4b10-907c3f80e549@postgrespro.ru
Whole thread Raw
In response to Некорректное пояснение к примеру в разделе 13.2.1  (Алексей Снытко <asnytko.krk@gmail.com>)
List pgsql-docs
Hello,

First of all, this english language forum.
For questions in Russian you can use pgsql-ru-general@lists.postgresql.org list or may be postgres.ru site.

As for your question.

BEGIN; 
UPDATE website SET hits = hits + 1; 
DELETE FROM website WHERE hits = 10; 
COMMIT;
In this example you forget a main part.
DELETE statement must be run in a second session, after UPDATE in first session, but before COMMIT.

Look carefully in a documentation:
BEGIN;
UPDATE website SET hits = hits + 1;
-- run from another session:  DELETE FROM website WHERE hits = 10;
COMMIT;

So, example is correct.

-----
Pavel Luzanov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


pgsql-docs by date:

Previous
From: Alexander Lakhin
Date:
Subject: Re: PDF build warnings
Next
From: Daniel Gustafsson
Date:
Subject: Documented toolchain for building docs on Windows