Re: Using transactions with plpythonu

Поиск
Список
Период
Сортировка
От imageguy
Тема Re: Using transactions with plpythonu
Дата
Msg-id 1169473527.216583.260550@s34g2000cwa.googlegroups.com
обсуждение исходный текст
Ответ на Re: Using transactions with plpythonu  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane wrote:
> "imageguy" <imageguy1206@gmail.com> writes:
> > So... unless I am missing something, I would suggest you CANNOT us
> > plpython (or perhaps any other pl language ??) to process transactions
>
> I think the point you are missing is that every function already runs
> within a transaction.  You can't issue BEGIN/COMMIT from within a
> function because that would represent destroying the transaction that
> supports your execution of the function.

Tom, I think this is what I was missing, and of course this makes
sense.

> AFAICT you are worried about whether several different updates issued by
> your function will all be committed atomically.  They will be; you don't
> need to, and indeed can't, do anything to adjust that.  If there was
> some other issue you had, you need to be more specific...
>
You are exactly right on this.  I was concered about the atomicity of
the updates.
In the test environment I setup, it appeared to me that each "INSERT"
was being committed immediately becuase and if the next transaction
failed it seemed I could still see the the previous transaction after
the function ended (ie. using pgAdminIII)

After reading your post, I will reset my "test" environment.  Clearly I
had a flaw somewhere or didn't understand the results I was seeing.

Thanks so much for your guidance on this. I will post back here once I
have completed the retesting.

Thanks.
Geoff.


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

Предыдущее
От: David Goodenough
Дата:
Сообщение: Is there an equivalent of the W3c HTML checker for SQL?
Следующее
От: Ron Johnson
Дата:
Сообщение: Re: Installing Postegres side-by-side with M$ SQL server