Re: Transaction blocks

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Transaction blocks
Date: 2005-08-11 13:24:51
Message-ID: 20050811132451.GA91227@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thu, Aug 11, 2005 at 04:03:45PM +0400, Alexander Kotelnikov wrote:
> >>>>> On Wed, 10 Aug 2005 18:25:57 -0600
> >>>>> "MF" == Michael Fuhr <mike(at)fuhr(dot)org> wrote:
> MF>
> MF> http://www.postgresql.org/docs/8.0/static/plpgsql-structure.html
> MF>
> MF> "Functions and trigger procedures are always executed within a
> MF> transaction established by an outer query -- they cannot start or
> MF> commit that transaction, since there would be no context for them
> MF> to execute in."
>
> Oops, I missed this, thanks. But what about PL's other than pgsql?

The statement itself (i.e., the outer query) has transaction
semantics, regardless of what language is used for the functions
it calls.

http://www.postgresql.org/docs/8.0/static/tutorial-transactions.html

"PostgreSQL actually treats every SQL statement as being executed
within a transaction. If you do not issue a BEGIN command, then
each individual statement has an implicit BEGIN and (if successful)
COMMIT wrapped around it. A group of statements surrounded by BEGIN
and COMMIT is sometimes called a _transaction block_."

--
Michael Fuhr

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2005-08-11 13:45:46 Re: connection trouble
Previous Message Sivakumar K 2005-08-11 12:56:38 Re: postgresql with ssl on windows