From: | Alvaro Herrera <alvherre(at)surnet(dot)cl> |
---|---|
To: | Jaime Casanova <systemguards(at)gmail(dot)com> |
Cc: | Ayuda Postgres <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | Re: Savepoints |
Date: | 2005-06-09 19:16:53 |
Message-ID: | 20050609191653.GC12706@surnet.cl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
On Thu, Jun 09, 2005 at 01:08:10PM -0500, Jaime Casanova wrote:
> Hola,
>
> Tengo una duda..
> Si tengo un script mas o menos asi...
>
> BEGIN WORK;
> SAVEPOINT t;
> DROP TABLE foo;
> RELEASE t;
>
> CREATE TABLE foo (....);
>
> COMMIT WORK;
>
> el script se va a cancelar a partir del drop table....
> como puedo lograr que el script ejecute un ROLLBACK TO t; en vez del
> RELEASE t;????
No puedes hacer eso en un script para psql :-( Tienes que usar algo mas
inteligente (un prog. en Perl o cualquier lenguaje)
Hace poco se discutio en -hackers un parche que hace que en psql se haga
auto-rollback-to cuando hay un error ... no me acuerdo si fue
incorporado o no.
--
Alvaro Herrera (<alvherre[a]surnet.cl>)
"The West won the world not by the superiority of its ideas or values
or religion but rather by its superiority in applying organized violence.
Westerners often forget this fact, non-Westerners never do."
(Samuel P. Huntington)
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2005-06-09 19:19:45 | Re: Posrgesql 8 y Python en plataformas W32 |
Previous Message | Ing. Jhon Carrillo - Caracas, Venezuela | 2005-06-09 19:12:21 | Python |