Re: table insert/primary key question

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Scot Kreienkamp *EXTERN*" <SKreien(at)la-z-boy(dot)com>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: table insert/primary key question
Date: 2014-04-04 07:46:36
Message-ID: A737B7A37273E048B164557ADEF4A58B17CEB196@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Armand Turpel 2014-04-04 08:20:56 hstore - jsonb
Previous Message Achilleas Mantzios 2014-04-04 07:16:24 Re: Linux vs FreeBSD