Create Rule

Started by Fernando San Martín Woernerover 24 years ago2 messagesgeneral
Jump to latest

i'm trying to do this

CREATE RULE borra_presupuesto AS ON DELETE TO presupuesto DO INSTEAD
(UPDATE presupuesto SET en_uso = 'False' WHERE cod_presupuesto =
old.cod_presupuesto;
UPDATE detalle_presupuesto SET en_uso = 'False' WHERE cod_presupuesto =
old.cod_presupuesto);

but i get this error:

ERROR: parser: parse error at or near ""

any tips?

thanks

Fernando San Mart�n Woerner
Jefe Depto. Inform�tica
Galilea S.A.
counter.li.org Linux User #216550
----------------------------------------
Una era construye ciudades, una hora las destruye.

S�neca

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Fernando San Martín Woerner (#1)
Re: Create Rule

=?iso-8859-1?Q?Fernando_San_Mart=EDn_Woerner?= <snmartin@galilea.cl> writes:

i'm trying to do this
CREATE RULE borra_presupuesto AS ON DELETE TO presupuesto DO INSTEAD
(UPDATE presupuesto SET en_uso = 'False' WHERE cod_presupuesto =
old.cod_presupuesto;
UPDATE detalle_presupuesto SET en_uso = 'False' WHERE cod_presupuesto =
old.cod_presupuesto);

but i get this error:
ERROR: parser: parse error at or near ""

Looks okay here: I get 'Relation "presupuesto" does not exist'
so it's getting past the parsing stage.

What PG version are you using? I have a vague recollection that
the syntax for multiple-action rules might have changed awhile back.

regards, tom lane