X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E3A9AD94FF for ; Thu, 22 Sep 2005 17:48:26 -0300 (ADT) 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 10274-04 for ; Thu, 22 Sep 2005 20:48:20 +0000 (GMT) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.199]) by svr1.postgresql.org (Postfix) with ESMTP id A16A4D91C0 for ; Thu, 22 Sep 2005 17:48:20 -0300 (ADT) Received: by xproxy.gmail.com with SMTP id i30so552585wxd for ; Thu, 22 Sep 2005 13:48:22 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=EJi79PknPFtoUbRkTNsZP1F3Z+IrjtlJ86tpv7odvbTxtGZQuoWde9vDGzgwBxOeLZsf+SS1Tg5RqC93oTQfQNELxC9cQ+BQjJMhbiMj2OLyldxamIFWf2e1nRQS63lEb5//QtKwmHKDfHMeCjiy3FqM8gJ+zWQZKxjAXpQncdk= Received: by 10.70.63.2 with SMTP id l2mr578877wxa; Thu, 22 Sep 2005 13:48:22 -0700 (PDT) Received: by 10.70.75.4 with HTTP; Thu, 22 Sep 2005 13:48:22 -0700 (PDT) Message-ID: Date: Fri, 23 Sep 2005 02:18:22 +0530 From: Rajesh Kumar Mallah Reply-To: Rajesh Kumar Mallah To: Kenneth Hutchinson Subject: Re: Issue with UPDATE statement on v8 Cc: pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.245 required=5 tests=[AWL=-0.611, RCVD_BY_IP=0.024, RCVD_IN_BL_SPAMCOP_NET=1.832] X-Spam-Level: * X-Archive-Number: 200509/216 X-Sequence-Number: 22763 On 9/23/05, Kenneth Hutchinson wrote: > Hello, > > I'm sorry if this has been sent to the community multiple times. I am > not able to determine whether my posts have gotten through. If you have > rec'd this multiple times, please let me know. > > We have recently migrated to Postgres 8 (not sure of exactly which > build). We have noticed that a few functions that were working > previously are no longer behaving as expected. One function in > particular is giving me a strange result. > > The function giving us the problem is much more complicated, but for > simplicity I've included one that is easier to read and results in the > same behavior. > > UPDATE t_summary > SET availability =3D 7 > WHERE oid =3D 28245084 > > When this query is executed (within a function or without) the database > will simply hang. see if the update statement is being blocked by some other statement by running following SQL stmt from another session while the first session = is hung SELECT h.pid AS blocker, w.pid AS blockee FROM ONLY pg_locks h, ONLY pg_locks w WHERE h.granted AND NOT w.granted AND (h.relation =3D w.relation AND h."database" =3D w."database" OR h."transaction" =3D w."transaction"); (sql above was posted by mr. Tom Lane in a particular reply) But You have to enable command string in statictics part of postgresql.conf file to know which pid corresponds to which sql. http://www.postgresql.org/docs/8.0/interactive/monitoring-stats.html#MONITO= RING-STATS-SETUP Hope it helps regds mallah. If the UPDATE is turned into a SELECT, the query > works just fine. For some reason, the UPDATE is just not working. This > same function/query works fines in Postgres 7.2. > > The schema for the targeted table is shown below. > > CREATE TABLE t_summary ( > id varchar(20) NULL, > availability int4 NULL DEFAULT 0, > ) > > Has anyone else experienced a similar issue? If more information is > needed to determine the problem, please let me know. I've trimmed down > the function's query and table's schema for this posting. > > Thanks in advance! > > kh > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings >