raise exception and transaction handling

Поиск
Список
Период
Сортировка
От Marcin Krawczyk
Тема raise exception and transaction handling
Дата
Msg-id 95f6bf9b0707281354n2f4772abmaba91132c466b3ac@mail.gmail.com
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: group by range of values
Следующее
От: roopa perumalraja
Дата:
Сообщение: increment the primary key value without using sequences