Search Postgresql Archives

Re:[GENERAL] auditing question - PARTIALY SOLVED

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

 



Hello,

with help of Bricklen, I have found that the problem is the scope of call EXECUTE. When this is called it seems to be "launched" outside of the trigger's scope and OLD/NEW is not defined. (Manual suggests it)

The remaining question is how to compare OLD.* and NEW.* in generic way for 8.0.x version

Regards,
Bohdan 

> 
>     IF TG_OP = 'DELETE' THEN
>         EXECUTE 'INSERT INTO audit.' || TG_RELNAME ||
>                 ' SELECT _name, now(), OLD.*;';
>         RETURN OLD;
> =====================
>  
> and binding the procedure to trigger AFTER INSERT,DELETE, UPDATE, gives me
> problem:
> 
> ERROR:  NEW used in query that is not in a rule
> CONTEXT:  SQL statement "INSERT INTO audit.communities SELECT _name, now(),
> row(NEW);"


[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