Re: transaction safety

From: DaVinci <bombadil(at)wanadoo(dot)es>
To: Lista PostgreSql <pgsql-general(at)postgresql(dot)org>
Subject: Re: transaction safety
Date: 2001-02-13 10:41:54
Message-ID: 20010213114154.B13288@fangorn.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Feb 13, 2001 at 09:56:18AM -0000, Michael Ansley wrote:
> Hi,
>
> Well, the number is 'locked', because once it's given to you, that's it,
> it's gone from the 'list of available numbers' (i.e.: the sequence).
> However, between the insert, and the read of the ID, if another transaction
> performs an insert, it does NOT affect the ID that the first transaction
> reads (i.e.: your ID read in the first transaction IS definitely still safe,
> it will still read the correct one).

I understand this.

> AND, the first insert does NOT block
> the second insert. The second insert could complete and commit before the
> first one.

But I don't know how to reproduce this part.

If I have two different sessions of psql connected to same database:

psql-1# begin;
psql-2# begin;
psql-1# insert into foo ...;
psql-2# insert into foo ...; <- Frozen!!!
psql-1# commit; <- psql-2 unfrozen

Why I get this?.

> Does this explain better?

Very well, thanks ;)

David

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Ansley 2001-02-13 10:58:07 RE: transaction safety
Previous Message Peter T Mount 2001-02-13 10:04:53 Re: jdbc connection pool settings