Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 23rd, 2005, 12:29 AM
Ciprian Popovici
Guest
 
Posts: n/a
Default Are functions automatically transactioned?

I need to perform a couple of queries in a function and I need them to be in
the same transaction. I understand I can't start and stop transactions from
inside the functions. But are the contents of a function placed in a
transaction automatically by the server, or do I have to "manually" control
the transaction around the call to the function?

--
Ciprian Popovici

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

  #2  
Old November 23rd, 2005, 12:29 AM
Kevin Lohka
Guest
 
Posts: n/a
Default Re: Are functions automatically transactioned?

Ciprian, I just saw this in the online docs at
http://www.postgresql.org/docs/7.4/i...structure.html

It is important not to confuse the use of BEGIN /END for grouping
statements in PL/pgSQL with the database commands for transaction
control. PL/pgSQL 's BEGIN /END are only for grouping; they do not
start or end a transaction. Functions and trigger procedures are
always executed within a transaction established by an outer query
--- they cannot start or commit transactions, since PostgreSQL does not
have nested transactions.

HTH

Kevin Lohka


On Wednesday, April 7, 2004, at 03:43 PM, Ciprian Popovici wrote:
[color=blue]
> But are the contents of a function placed in a
> transaction automatically by the server, or do I have to "manually"
> control
> the transaction around the call to the function?
>
> --
> Ciprian Popovici
>[/color]

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles