Re: Insert behavior in transaction

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Andres" <andres1981(at)gawab(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Insert behavior in transaction
Date: 2005-06-20 01:08:54
Message-ID: 17391.1119229734@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Andres" <andres1981(at)gawab(dot)com> writes:
> I did this simple test and it fails too.

> BEGIN (first transaction)
> INSERT INTO mytable VALUES(1);

> On other client
> BEGIN (second transaction)
> INSERT INTO mytable VALUES(0);
> INSERT INTO mytable VALUES(1);

> and it freezes waiting for the first o commit or rollback

Not too surprising if the second insert would imply a unique-key
violation. It has to wait to see if the first insertion of "1"
is going to commit or not.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-06-20 01:13:39 Re: unicode and =
Previous Message Grant Morgan 2005-06-20 00:54:33 unicode and =