Re: Transaction Handling in pl/pgsql?

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: "Nee(dot)mem(倪明)" <neemem(at)atlas-china(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Transaction Handling in pl/pgsql?
Date: 2005-07-13 05:35:39
Message-ID: 42D4A82B.6080803@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 space map 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nee.mem (倪明) 2005-07-13 05:55:39 can you tell me how to use rollback work in 'pgsql' function? and give me a exsample?
Previous Message Jean-Max Reymond 2005-07-13 05:18:32 Re: Projecting currentdb to more users