X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 73F2B3A5C1E for ; Sat, 4 Dec 2004 16:56:50 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 93344-05 for ; Sat, 4 Dec 2004 16:56:44 +0000 (GMT) Received: from web51306.mail.yahoo.com (web51306.mail.yahoo.com [206.190.38.172]) by svr1.postgresql.org (Postfix) with SMTP id 6128D3A2B22 for ; Sat, 4 Dec 2004 16:56:43 +0000 (GMT) Received: (qmail 75037 invoked by uid 60001); 4 Dec 2004 16:56:41 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=A/n3CK7ff0KQ0E05kjekjaA88x5Q3JJRclp+R6+/pALXWxiWlMpCmJe2x1cJ+YKG6KhS1NXQ+PEMkF+KR1u65bQVGJJNAOlKZhC0IdWYELJDRLP3YpjA+SW7bLhtCqn0nlRyiwMjsHed5umMWQSwzG/h0L5BJlMdwLlfUYm7Bgg= ; Message-ID: <20041204165641.75035.qmail@web51306.mail.yahoo.com> Received: from [65.218.182.242] by web51306.mail.yahoo.com via HTTP; Sat, 04 Dec 2004 08:56:41 PST Date: Sat, 4 Dec 2004 08:56:41 -0800 (PST) From: sarlav kumar Subject: lock problem To: pgsqlperform MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-241292561-1102179401=:74288" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.415 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, HTML_10_20, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200412/97 X-Sequence-Number: 9472 --0-241292561-1102179401=:74288 Content-Type: text/plain; charset=us-ascii Hi All, Thanks for the information on replication tools!! Now, I have a question regarding locking tables and updating tables that have a relationship to the locked table. I opened up two pgsql windows logged in using same userid. 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 the above update statement 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!? Yahoo! Mail - Easier than ever with enhanced search. Learn more. --0-241292561-1102179401=:74288 Content-Type: text/html; charset=us-ascii
Hi All,

Thanks for the information on replication tools!!
 
Now, I have a question regarding locking tables and updating tables that have a relationship to the locked table.

I opened up two pgsql windows logged in using same userid.
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 the above update statement 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!?
Yahoo! Mail - Easier than ever with enhanced search. Learn more. --0-241292561-1102179401=:74288--