Re: transaction safety - Mailing list pgsql-general

From DaVinci
Subject Re: transaction safety
Date
Msg-id 20010213114154.B13288@fangorn.net
Whole thread Raw
In response to RE: transaction safety  (Michael Ansley <Michael.Ansley@intec-telecom-systems.com>)
List 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

pgsql-general by date:

Previous
From: Peter T Mount
Date:
Subject: Re: jdbc connection pool settings
Next
From: Michael Ansley
Date:
Subject: RE: transaction safety