postgresql trigger functions are

Your trigger will not fire when date is null. The condition “date < $3” evaluates to NULL when date is NULL. The “AND” requires both conditions return TRUE, since NULL is not TRUE no rows are affected so as @GMB indicates the trigger does not fire. If your trigger function will be setting the date column then perhaps you want:

update tablea 
   set column1 = $1 
 where id = $2 
   and (date < $3 or date is null) ;

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top