pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pavel Luzanov <p.luzanov@postgrespro.ru>
To: pgsql-docs@lists.postgresql.org
Subject: Re: Некорректное пояснение к примеру в разделе 13.2.1
Date: Wed, 27 Jun 2018 13:01:03 +0300
Message-ID: <4b95bfe2-e1e3-0716-4b10-907c3f80e549@postgrespro.ru> (raw)
In-Reply-To: <CAF+QRgkFacxcfH3evASRjRi3aXqAte4QS+G43t6DDGRdf=zFCA@mail.gmail.com>
References: <CAF+QRgkFacxcfH3evASRjRi3aXqAte4QS+G43t6DDGRdf=zFCA@mail.gmail.com>

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

view thread (2+ messages)

Message-ID: <4b95bfe2-e1e3-0716-4b10-907c3f80e549@postgrespro.ru>
Permalink:  ../4b95bfe2-e1e3-0716-4b10-907c3f80e549@postgrespro.ru/
Also on:    postgresql.org/message-id/4b95bfe2-e1e3-0716-4b10-907c3f80e549@postgrespro.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: p.luzanov@postgrespro.ru, pgsql-docs@lists.postgresql.org
  Subject: Re: Некорректное пояснение к примеру в разделе 13.2.1
  In-Reply-To: <4b95bfe2-e1e3-0716-4b10-907c3f80e549@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox