Re: Insert waiting for update?

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: <ashish_postgre(at)yahoo(dot)co(dot)in>
Cc: "pggeneral" <pgsql-general(at)postgresql(dot)org>, <ashish(dot)karalkar(at)netcore(dot)co(dot)in>
Subject: Re: Insert waiting for update?
Date: 2008-01-09 17:19:51
Message-ID: D960CB61B694CF459DCFB4B0128514C2C4D862@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ashish Karalkar wrote:
> I am having table with 4M rows.
> I am trying to update all these rows with statement
>
> update mytable set mycolumn=0;
>
> At the same time there are insert happening on the table.
> but all these insert are in waiting mode.
> does update is locking the table for insert?
>
> does insert and update confilict with each other?
>
> For more details:
>
> I have two tables master,child.
> with child having fk to master.
>
> Now that master table contains 4M rows . while I update them
> (Master table) the inserts are going into waiting mode on child table.
>
>
> Update acquired row exclusive lock on master table , and
> the insert on child table acquired access share and share
> lock,row share on master.
>
> Is this is what preventing for inserting records into child
> table, I mean is the row exclusive lock conflicting with the
> locks insert wants to hold?

Please post the table definitions including indexes and constraints.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Josh Harrison 2008-01-09 17:24:37 Re: quick question abt pg_dump and restore
Previous Message Josh Harrison 2008-01-09 17:19:11 Re: quick question abt pg_dump and restore