Re: Transaction isolation and constraints

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: cliff(at)krumvieda(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Transaction isolation and constraints
Date: 2007-12-05 03:46:37
Message-ID: 11399.1196826397@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

cliff(at)krumvieda(dot)com writes:
> suppose a table has a UNIQUE constraint on a column, and two
> concurrent transactions attempt to INSERT a row with the same value
> for that column:

Whichever one manages to get to the index page first will go through.
The second one will block waiting to see if the first one commits,
and will error out if so --- or proceed, if it aborts.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-12-05 04:00:15 Re: Deadlock when updating table partitions (and presumed solution)
Previous Message Tom Lane 2007-12-05 03:37:58 Re: bug with >to_char('2007-12-31'::DATE, 'YYYYIW')<