From: Oliver Elphick <olly@lfix.co.uk>
To: Ramesh PAtel <ramesh@banas.guj.nic.in>
Cc: pgsql-admin@postgresql.org
Cc: mahim_engg_2003@yahoo.com
Subject: Re: Some one plz help me (MAHENDRA D RATHOD)
Date: 12 May 2003 12:48:00 +0100
Message-ID: <1052740079.18710.7.camel@linda.lfix.co.uk> (raw)
In-Reply-To: <3EBFCA5E.28219.12E5A36@localhost>
References: <3EBFCA5E.28219.12E5A36@localhost>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: olly@lfix.co.uk, ramesh@banas.guj.nic.in, mahim_engg_2003@yahoo.com
Subject: Re: Some one plz help me (MAHENDRA D RATHOD)
In-Reply-To: <1052740079.18710.7.camel@linda.lfix.co.uk>
References: <3EBFCA5E.28219.12E5A36@localhost> <1052740079.18710.7.camel@linda.lfix.co.uk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox