pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paesold <mpaesold@gmx.at>
To: Tsirkin Evgeny <tsurkin@mail.jct.ac.il>
Cc: pgsql-admin@postgresql.org
Subject: Re: duplicates
Date: Mon, 6 Sep 2004 12:51:45 +0200
Message-ID: <00be01c493ff$82814530$ad01a8c0@zaphod> (raw)
References: <Pine.LNX.4.58.0409060922390.20253@p-roman.jct.ac.il>
	<008601c493e5$e0965940$0b00a8c0@forge>
	<Pine.LNX.4.58.0409061050190.20694@p-roman.jct.ac.il>
	<00c701c493eb$def5b9e0$0b00a8c0@forge>
	<Pine.LNX.4.58.0409061211580.20694@p-roman.jct.ac.il>
	<009501c493f6$52932770$ad01a8c0@zaphod>
	<Pine.LNX.4.58.0409061252510.20694@p-roman.jct.ac.il>
	<00a701c493fd$dd44d060$ad01a8c0@zaphod>

I wrote:

> BEGIN;
> SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
>
> DELETE FROM schedule WHERE studentid = ... ;
> INSERT INTO schedule (studentid, ...) VALUES (... );
> INSERT INTO schedule (studentid, ...) VALUES (... );
>
> COMMIT;
>
> If you do it like in the above sql code, there is still a problem. The
> serializable checking here only works, if DELETE FROM schedule... really
> finds at least one row. If it does not, it will not recognize the
> serialization problem. So it's still possible that your programm creates
> duplicates.
>
> I have tested this here. I don't really know if this is just the case with
> PostgreSQL serializable transactions (MVCC limitation) or a general
problem.

There is a detailed description about this problem in Section 12.2.2.1. of
the PostgreSQL 8 docs here:
http://developer.postgresql.org/docs/postgres/transaction-iso.html

(Serializable Isolation versus True Serializability)

Best Regards,
Michael Paesold




view thread (14+ messages)  latest in thread

Message-ID: <00be01c493ff$82814530$ad01a8c0@zaphod>
Permalink:  ../00be01c493ff$82814530$ad01a8c0@zaphod/
Also on:    postgresql.org/message-id/00be01c493ff$82814530$ad01a8c0@zaphod

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: mpaesold@gmx.at, tsurkin@mail.jct.ac.il
  Subject: Re: duplicates
  In-Reply-To: <00be01c493ff$82814530$ad01a8c0@zaphod>
  References: <Pine.LNX.4.58.0409060922390.20253@p-roman.jct.ac.il> <008601c493e5$e0965940$0b00a8c0@forge> <Pine.LNX.4.58.0409061050190.20694@p-roman.jct.ac.il> <00c701c493eb$def5b9e0$0b00a8c0@forge> <Pine.LNX.4.58.0409061211580.20694@p-roman.jct.ac.il> <009501c493f6$52932770$ad01a8c0@zaphod> <Pine.LNX.4.58.0409061252510.20694@p-roman.jct.ac.il> <00a701c493fd$dd44d060$ad01a8c0@zaphod> <00be01c493ff$82814530$ad01a8c0@zaphod>

* 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