Search code examples
postgresqlplpgsqldatabase-triggerenterprisedb

PostgreSQL : IF UPDATING ( COLUMN NAME ) equivalent in postgres


I am doing a Oracle to EDB Migration. In oracle i have used :

IF UPDATING(column name) and :OLD.value <> :NEW.value THEN

But I am unable to use the syntax in Postgres and need to make changes. Kindly suggest how to implement the functionality in EDB.


Solution

  • If you use row trigger, then you can write

    IF OLD.column_name IS DISTINCT FROM NEW.column_name THEN