Search Postgresql Archives

Re: Conditionnal validation for transaction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 19, 2012 at 3:28 PM, Florent THOMAS <mailinglist@xxxxxxx> 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. But then you don't need to
because you can do a conditional error or drop through to a commit.

-- 
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux