Re: problemas con trigger

From: Juan <smalltalker(dot)marcelo(at)gmail(dot)com>
To: Raul Andres Gutierrez Alejo <raulandrez(at)gmail(dot)com>
Cc: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: problemas con trigger
Date: 2012-11-08 00:27:25
Message-ID: CAKizN9zFmPrrNhMt3AC41waOZ1ptcyt_HWSvDLfjgOjZa1JoXg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Gracias gente por tomarse el tiempo para responder , pero ya lo solucione,
el problema estaba
entre el teclado y la silla :( :):):):)
salu2

jmdc

2012/11/7 Raul Andres Gutierrez Alejo <raulandrez(at)gmail(dot)com>

> NEW es valido en INSERT Y UPDATE
> OLD es valido en UPDATE Y DELETE
> con esta función puede probar los valores para cualquier tabla.
>
> CREATE OR REPLACE FUNCTION tr_datos_d()
> RETURNS trigger AS
> $BODY$
> DECLARE
> BEGIN
> IF TG_OP = 'INSERT' THEN
> RAISE NOTICE 'INSERT NEW %',NEW;
> RETURN NEW;
> END IF;
> IF TG_OP = 'UPDATE' THEN
> RAISE NOTICE 'UPDATE NEW %',NEW;
> RAISE NOTICE 'UPDATE OLD %',OLD;
>
> RETURN NEW;
> END IF;
> IF TG_OP = 'DELETE' THEN
> RAISE NOTICE 'DELETE OLD %',OLD;
> RETURN OLD;
> END IF;
>
> END;$BODY$
> LANGUAGE plpgsql VOLATILE
> COST 100;
>
> El 07/11/2012 04:14 p.m., Jaime Casanova escribió:
>
>> 2012/11/7 Juan <smalltalker(dot)marcelo(at)gmail(dot)com**>:
>>
>>> Jaime
>>>
>>> Lo extraño es que para hacer el test yo use update
>>> por lo que entiendo update manda inicializado el New.
>>> lo raro es que ambos new y old estan en null.
>>> cualquier idea sera agradecida
>>>
>> y como determinas que NEW y OLD vienen en null?
>> te da algun error?
>>
>> --
>> Jaime Casanova www.2ndQuadrant.com
>> Professional PostgreSQL: Soporte 24x7 y capacitación
>> Phone: +593 4 5107566 Cell: +593 987171157
>>
>> -
>> Enviado a la lista de correo pgsql-es-ayuda (
>> pgsql-es-ayuda(at)postgresql(dot)org**)
>> Para cambiar tu suscripción:
>> http://www.postgresql.org/**mailpref/pgsql-es-ayuda<http://www.postgresql.org/mailpref/pgsql-es-ayuda>
>>
>
>
> -
> Enviado a la lista de correo pgsql-es-ayuda (pgsql-es-ayuda(at)postgresql(dot)org
> **)
> Para cambiar tu suscripción:
> http://www.postgresql.org/**mailpref/pgsql-es-ayuda<http://www.postgresql.org/mailpref/pgsql-es-ayuda>
>

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message José Fermín Francisco Ferreras 2012-11-09 16:43:03 Relacionar tablas cliente y telefono
Previous Message Raul Andres Gutierrez Alejo 2012-11-07 21:22:16 Re: problemas con trigger