Re: table insert/primary key question

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: table insert/primary key question
Дата
Msg-id A737B7A37273E048B164557ADEF4A58B17CEB196@ntex2010i.host.magwien.gv.at
обсуждение исходный текст
Ответ на table insert/primary key question  (Scot Kreienkamp <SKreien@la-z-boy.com>)
Список 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 по дате отправления:

Предыдущее
От: Achilleas Mantzios
Дата:
Сообщение: Re: Linux vs FreeBSD
Следующее
От: Armand Turpel
Дата:
Сообщение: hstore - jsonb