Questions regarding interaction of stored functions and transactions

Поиск
Список
Период
Сортировка
От Bill Moran
Тема Questions regarding interaction of stored functions and transactions
Дата
Msg-id 20050324094941.5cf76c2d.wmoran@potentialtech.com
обсуждение исходный текст
Ответы Re: Questions regarding interaction of stored functions  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: Questions regarding interaction of stored functions and transactions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I'm a little fuzzy on this, and I've been unable to find docs that clear
it up for me.  A pointer to a helpful doc would be just as welcome as an
outright explanation ;)

Let's take the following fictional scenerio:

BEGIN;
INSERT INTO table1 VALUES ('somestring');
INSERT INTO table1 VALUES ('anotherstring');
SELECT user_defined_function();
COMMIT;

In this case, user_defined_function() does a lot more table manipulation.
I don't want that to be done if any statement prior fails, but it seems as
if it's always done, regardless.  It seems as if the second INSERT is not
executed if the first fails, but the function is always called.

So ... I'm a little fuzzy on this.  Is there a doc that details this
behaviour?

TIA.

--
Bill Moran
Potential Technologies
http://www.potentialtech.com

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: multi line text data/query ?bug?
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: Good Books