Re: Transactions within a function

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Daniel Åkerud <zilch(at)home(dot)se>
Cc: PostgreSQL-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Transactions within a function
Date: 2001-07-06 13:23:36
Message-ID: 200107061323.f66DNaJ21413@jupiter.us.greatbridge.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice pgsql-sql

Daniel Åkerud wrote:
> Do the BEGIN and END in a function also indicate that it is done in a transaction?
> Or can you put another BEGIN TRANSACTION; END TRANSACTION; in there?

The BEGIN and END keywords in PL/pgSQL have absolutely no
transactional meaning. They group statements into blocks with
the possibility of named blocks using the <<label>> syntax
and then beeing able to EXIT up multiple block levels at
once.

Since every SQL statement sent to the backend outside of an
explicit transaction block has it's own implicit transaction
and we don't have subtransactions yet, there is no
possibility for transaction control inside of functions.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Morgan Curley 2001-07-06 13:30:02 Cross database foreign keys
Previous Message Brent R. Matzelle 2001-07-06 13:20:05 Re: which Python interface

Browse pgsql-novice by date

  From Date Subject
Next Message Morgan Curley 2001-07-06 13:30:02 Cross database foreign keys
Previous Message Daniel Åkerud 2001-07-06 12:40:08 Transactions within a function

Browse pgsql-sql by date

  From Date Subject
Next Message Morgan Curley 2001-07-06 13:30:02 Cross database foreign keys
Previous Message Daniel Åkerud 2001-07-06 12:40:08 Transactions within a function