Skip site navigation (1) Skip section navigation (2)

Re: Trigger before delete no ejecuta el delete

From: Alejandro Carrillo <fasterzip(at)yahoo(dot)es>
To: Gaston Rider <gastonrider(at)hotmail(dot)com>
Cc: SQL Ayuda Postgre <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: Trigger before delete no ejecuta el delete
Date: 2012-03-22 19:07:41
Message-ID: 1332443261.71044.YahooMailNeo@web171006.mail.ukl.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-es-ayuda
return OLD;

ej:

create or replace function public.fn_borradocopia () returns trigger
as
$$
declare 
    reg hstore; 
    r record;
begin    
    IF TG_WHEN != 'BEFORE' OR TG_OP != 'DELETE' OR (TG_LEVEL = 'STATEMENT' AND TG_OP <> 'TRUNCATE') THEN
        RAISE EXCEPTION 'Esta función solo aplica cuando el trigger es BEFORE DELETE ... FOR EACH ROW';
    END IF;
    reg:=hstore(OLD);
    insert into borradoscopia values (current_user,inet_client_addr(),TG_TABLE_SCHEMA, TG_TABLE_NAME,reg);
    return OLD;
end;
$$
LANGUAGE plpgsql VOLATILE
  COST 100;




>________________________________
> De: Gaston Rider <gastonrider(at)hotmail(dot)com>
>Para: Postgres Lista <pgsql-es-ayuda(at)postgresql(dot)org> 
>Enviado: Jueves 22 de marzo de 2012 14:00
>Asunto: [pgsql-es-ayuda] Trigger before delete no ejecuta el delete
> 
>
> 
>Hola,
>
>
>he realizado un Trigger before delete...
>
>
>esta funicion despues de realizar unos cambios en otras tablas...
>
>
>devuelve NULL
>
>
>es por esto que no me ejecuta el DELETE? de debería devolve?
>
>
>muchas gracias
>
>

In response to

pgsql-es-ayuda by date

Next:From: Alvaro HerreraDate: 2012-03-22 19:13:03
Subject: Re: Trigger before delete no ejecuta el delete
Previous:From: Gaston RiderDate: 2012-03-22 19:00:42
Subject: Trigger before delete no ejecuta el delete

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group