lock problem

From: sarlav kumar <sarlavk(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: lock problem
Date: 2004-11-23 20:46:33
Message-ID: 20041123204633.70992.qmail@web51308.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi All,

I have a problem with locking tables and updating tables that have a relationship to the locked table.

I opened up two pgsql windows logged in using same user.
Let's say I lock a table "customerdata" on one window.
begin;
lock table customerdata;

Then in the other window,I want to make an update to table "customer".
begin;
update customer set status=0 where id=111;

The relation ship between the two tables is as follows
customerdata.uid is FK on customer.id. There are no triggers that will try to update customerdata table when update statement above is issued.

My problem is the update does not continue unless the lock on customerdata is released. Is it because the lock statement does a lock on all related tables? Is it possible to lock only the particular table we want to lock and not the related tables?

Any help would be appreciated. Thanks in advance.

Thanks,
Saranya



---------------------------------
Do you Yahoo!?
Discover all thats new in My Yahoo!

Browse pgsql-novice by date

  From Date Subject
Next Message sarlav kumar 2004-11-23 20:52:46 difference between not null and <> null
Previous Message George Weaver 2004-11-23 16:13:36 Re: xml2 compile error - work_mem undeclared