Search Postgresql Archives

[Triggers] Check if OLD or NEW records are NULL

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

 



Dear All,

Can I check if OLD record is NULL in trigger function.
I'm using tg_op and check if it's UPDATE, etc. but I need check if OLD
record exists.
Is it possible?

f.i.

--------------------------------------------
IF OLD IS NOT NULL THEN

  IF OLD.identity IS NULL THEN
    tg_op_final:=''INSERT'';
  ELSE
    tg_op_final:=''UPDATE'';
  END IF;

ELSE
tg_op_final:=''FILL_BY_DATALOADER'';
END IF;
-------------------------------------------


Thanks!
-- 
Best Regards
Maciek



[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