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

From: Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Некорректное пояснение к примеру в разделе 13.2.1
Date: 2018-06-27 10:01:03
Message-ID: 4b95bfe2-e1e3-0716-4b10-907c3f80e549@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Hello,

First of all, this english language forum.
For questions in Russian you can use
pgsql-ru-general(at)lists(dot)postgresql(dot)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

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Daniel Gustafsson 2018-06-28 10:17:39 Documented toolchain for building docs on Windows
Previous Message Alexander Lakhin 2018-06-27 06:27:27 Re: PDF build warnings