raise exception and transaction handling - Mailing list pgsql-sql

From Marcin Krawczyk
Subject raise exception and transaction handling
Date
Msg-id 95f6bf9b0707281354n2f4772abmaba91132c466b3ac@mail.gmail.com
Whole thread Raw
List pgsql-sql
Hi,<br />I have a problem with transaction
handling. What I need to do is execute an INSERT command that would not be canceled by the <br/>RAISE EXCEPTION command
inAFTER UPDATE TRIGGER. A piece of code: <br /><br />BEGIN<br />-- some computations <br /><br />bledne := (SELECT
g.q_sumka('Poz.'|| lps || ' - min. cena: ' || cena || ' ' || waluta ||'; ') FROM g.m_lista WHERE idf = NEW.id);<br
/><br/>IF EXISTS (SELECT 1 FROM g.m_lista WHERE idf = NEW.id) THEN<br />RAISE EXCEPTION 'CENY NIE SPELNIAJA WARUNKOW!
%',rtrim(bledne);<br /> BEGIN<br /> INSERT INTO g.m_proba VALUES (1,2); -- this is the operation I need to perform but
theRAISE EXCEPTION above cancels it out <br /> PREPARE TRANSACTION 'a';<br /> COMMIT PREPARED 'a';<br /> END;<br />END
IF;<br/><br />I tried to do it as shown above, with PREPARE and COMMIT but it's not working. <br /> 

pgsql-sql by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: group by range of values
Next
From: roopa perumalraja
Date:
Subject: increment the primary key value without using sequences