Skip site navigation (1) Skip section navigation (2)

Re: function transaction scope question

From: "Christopher Browne" <cbbrowne(at)gmail(dot)com>
To: "Wright, George" <George(dot)Wright(at)infimatic(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: function transaction scope question
Date: 2009-01-14 15:47:54
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
On Wed, Jan 14, 2009 at 9:41 AM, Wright, George
<George(dot)Wright(at)infimatic(dot)com> wrote:
> If a function in PL/pgSQL is wrapped by a transaction, does that same single
> transaction encompass other functions defined elsewhere that this function
> calls?

There's a rather stronger condition than that to be claimed...

*EVERY* PostgreSQL stored function call (irrespective of language)
runs within the context of a particular transaction.  That transaction
context will therefore include all of the following:
 - any functions that the stored function may call
 - any triggers that may be fired by virtue of table updates
 - invocation of NOTIFY (but *not* the notifications that result in
listening connections)

That's quite comfortably stronger than what you appear to be hoping for :-).
Steve Martin  - "I like a woman with a head on her shoulders. I hate necks."

In response to


pgsql-novice by date

Next:From: Wright, GeorgeDate: 2009-01-14 19:56:10
Subject: another transaction question
Previous:From: John DeSoiDate: 2009-01-14 14:59:14
Subject: Re: function transaction scope question

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group