Re: table insert/primary key question - Mailing list pgsql-general

From Albe Laurenz
Subject Re: table insert/primary key question
Date
Msg-id A737B7A37273E048B164557ADEF4A58B17CEB196@ntex2010i.host.magwien.gv.at
Whole thread Raw
In response to table insert/primary key question  (Scot Kreienkamp <SKreien@la-z-boy.com>)
List pgsql-general
Scot Kreienkamp wrote:
> I have a table like so:
> 
> Receiptlimitid: BIGINT (Primary Key)
> Profitcenterid: BIGINT
> Receiptnumber: INTEGER
> 
> All are set to Not Null also.
> 
> 
> My question is, if I have an insert that goes idle in transaction for a while before it commits, will
> it stop all other inserts from happening on the table?  If so, is that because of the possible
> violation of the primary key by the following pending inserts?  Just trying to confirm the behavior
> I'm seeing and make sure I understand what's going on.

Other INSERTs shouldn't be blocked unless you try to insert
a record with the same primary key as the one in the open transaction.

If you experience any such problems, check pg_locks for what's
going on.  Are there any foreign keys involved?

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: Achilleas Mantzios
Date:
Subject: Re: Linux vs FreeBSD
Next
From: Armand Turpel
Date:
Subject: hstore - jsonb