Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 0868A9FA071 for ; Sat, 20 Oct 2007 03:05:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 08006-04 for ; Sat, 20 Oct 2007 03:05:43 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by postgresql.org (Postfix) with ESMTP id 7A9919FA06C for ; Sat, 20 Oct 2007 03:05:44 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.1/8.14.1) with ESMTP id l9K65g8p035755 for ; Sat, 20 Oct 2007 03:05:42 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.1/8.14.1/Submit) id l9K60x1A034519 for pgsql-admin@postgresql.org; Sat, 20 Oct 2007 03:00:59 -0300 (ADT) (envelope-from news) From: yogesh X-Newsgroups: pgsql.admin Subject: Re: Trigger AFTER UPDATE OR INSERT Date: Sat, 20 Oct 2007 06:00:50 -0000 Organization: http://groups.google.com Lines: 43 Message-ID: <1192860050.514202.74290@v23g2000prn.googlegroups.com> References: <1192777762.618697.226800@e34g2000pro.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Complaints-To: groups-abuse@google.com In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.8) Gecko/20071008 Firefox/2.0.0.8,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 SUMAN1, 1.1 SIFY Complaints-To: groups-abuse@google.com Injection-Info: v23g2000prn.googlegroups.com; posting-host=124.30.27.18; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 To: pgsql-admin@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/199 X-Sequence-Number: 27113 On Oct 19, 11:05 pm, scott.marl...@gmail.com ("Scott Marlowe") wrote: > On 10/19/07, yogesh wrote: > > > Hello frnds, > > I have a trigger on a table with After UPDATE OR INSERT ..that insert > > a record in an another table..........If the Trigger Fire Correctly > > the row is inserted or updated in the database as the case is. But if > > it is not fire correctly then the table is also not updated on which > > the trigger is.............. > > > Is it the right .................? if yes......How to insert the > > record in the table if the trigger is failed. > > Yes, it's right. Triggers are part of a transaction (or run their > own) so if the trigger fails, so does the transaction. > > If you really need to have something insert rather or not the > transaction succeeds, you can either use savepoints so that you can > roll back to before the error then insert the row anyway, or use > dblink to connect to the db through another backend and commit your > data that way. > > You might want to give more info on exactly what you're trying to do > so the folks on the list can make better informed recommendations. > > ---------------------------(end of broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match Hello Scott, Thanks to you.... you got the right point point what i want to know....... are you saying about programming or any other way to done it........to insert a row even if the Trigger fails or succeeds Regards, Yogesh Arora