Re: Conditionnal validation for transaction

From: Florent THOMAS <mailinglist(at)tdeo(dot)fr>
To: "pgsql-general(at)postgresql(dot)org >> \"pgsql-general(at)postgresql(dot)org\"" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Conditionnal validation for transaction
Date: 2012-03-19 20:53:33
Message-ID: 4F679CCD.1070709@tdeo.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Le 19/03/2012 16:57, Simon Riggs a écrit :
> On Mon, Mar 19, 2012 at 3:28 PM, Florent THOMAS<mailinglist(at)tdeo(dot)fr> wrote:
>> Hy all of you,
>>
>> 1 - Is there a way to have conditions for committing transactions like in
>> oracle :
>> http://www.scribd.com/doc/42831667/47/Validation-conditionnelle-de-transaction-62
>>
>> 2 - Is there a way to declare local variables for a SQL statement without
>> beiing in a function?
> PostgreSQL follows the SQL standard which does not allow anything like that.
>
> Later versions do allow anonymous blocks, also known as DO statements
> that allow you to execute some code to allow decision making like
> that. So the Oracle example is very similar code in PostgreSQL, except
> that you can't issue ROLLBACK and COMMIT.
Thanks, Could you precise the sentence bellow
> But then you don't need to
> because you*can do a conditional error or drop through to a commit*.
How do you do that?

Regards

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Crawford 2012-03-19 21:19:29 Re: nice'ing the postgres COPY backend process to make pg_dumps run more "softly"
Previous Message Guillaume Lelarge 2012-03-19 20:51:58 Re: nice'ing the postgres COPY backend process to make pg_dumps run more "softly"