X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A51B84758F1 for ; Mon, 12 May 2003 07:48:14 -0400 (EDT) Received: from anchor-post-33.mail.demon.net (anchor-post-33.mail.demon.net [194.217.242.91]) by postgresql.org (Postfix) with ESMTP id C04D447580B for ; Mon, 12 May 2003 07:48:03 -0400 (EDT) Received: from lfix.demon.co.uk ([158.152.59.127] helo=linda.lfix.co.uk) by anchor-post-33.mail.demon.net with esmtp (Exim 3.35 #1) id 19FBmi-0002we-0X; Mon, 12 May 2003 12:48:01 +0100 Received: from localhost ([127.0.0.1] ident=olly) by linda.lfix.co.uk with esmtp (Exim 3.36 #1 (Debian)) id 19FBmi-0005wv-00; Mon, 12 May 2003 12:48:00 +0100 Subject: Re: Some one plz help me (MAHENDRA D RATHOD) From: Oliver Elphick To: Ramesh PAtel Cc: pgsql-admin@postgresql.org, mahim_engg_2003@yahoo.com In-Reply-To: <3EBFCA5E.28219.12E5A36@localhost> References: <3EBFCA5E.28219.12E5A36@localhost> Content-Type: text/plain Organization: LFIX Limited Message-Id: <1052740079.18710.7.camel@linda.lfix.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 12 May 2003 12:48:00 +0100 Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-38.8 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES,USER_AGENT_XIMIAN autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/137 X-Sequence-Number: 8699 On Mon, 2003-05-12 at 11:53, Ramesh PAtel wrote: > My self is Mahendra D Rathod. > > I have some problem in executing trigger at backend side > > One trigger is fired AFTER INSERT OR UPDATE ON mtrl_issue_detail > > So when any row of "mtrl_issue_detail" is inserted or updated this > trigger is fired on one function. > > This function updates the same row that has just been inserted or > updated. > > Now when this process happens the database gets HANGED. and i have to > restart the database on server. This is hardly surprising, because you have explicitly set up an infinite loop. If you wish to change the record being updated or inserted, you should use a BEFORE trigger, change NEW (the record to be inserted or the after-update record) and return NEW. Check the documentation: Programmer's Manual Procedural Languages PL/pgSQL Trigger procedures -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight, UK http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C ======================================== "Study to show thyself approved unto God, a workman who does not need to be ashamed and who correctly handles the word of truth." II Timothy 2:15