Re: Transaction Handling in pl/pgsql? - Mailing list pgsql-general

From Joshua D. Drake
Subject Re: Transaction Handling in pl/pgsql?
Date
Msg-id 42D4A82B.6080803@commandprompt.com
Whole thread Raw
In response to Transaction Handling in pl/pgsql?  ("Nee.mem(倪明)" <neemem@atlas-china.com>)
Responses Re: Transaction Handling in pl/pgsql?
List pgsql-general
>>your_function adds some rows but the last one gives an error, because
>>all statements that are out of a transaction block are in its own
>>transaction the select calling your_function is inside a
>>transaction... so, the answer is yes... the statements inside the
>>function will be rolled back
>

Unless you are using savepoints in 8.x, any error you generate will
automatically cause the need to rollback.

If you are using savepoints you can rollback to a specific point of
a parent transaction.



Sincerely,

Joshua D. Drake


>
>
>
> How to use rollback  work in pl/pgsql functions.? Give an example
>
>
> ---------------------------(end of broadcast)---------------------------TIP 5: don't forget to increase your free
spacemap settings 


--
Your PostgreSQL solutions provider, Command Prompt, Inc.
24x7 support - 1.800.492.2240, programming, and consulting
Home of PostgreSQL Replicator, plPHP, plPerlNG and pgPHPToolkit
http://www.commandprompt.com / http://www.postgresql.org

pgsql-general by date:

Previous
From: "Nee.mem(倪明)"
Date:
Subject: Transaction Handling in pl/pgsql?
Next
From: "Nee.mem(倪明)"
Date:
Subject: can you tell me how to use rollback work in 'pgsql' function? and give me a exsample?