Trigger with conditional predicates

From: Dirk Mika <Dirk(dot)Mika(at)mikatiming(dot)de>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Trigger with conditional predicates
Date: 2021-01-01 15:56:32
Message-ID: A4A3D4D4-B8C9-4ED2-B10D-0A908D639F99@mikatiming.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all and a happy new Year!

We have an Oracle schema that is to be converted to PostgreSQL, where conditional predicates are used in some triggers.

In particular, columns are populated with values if they are not specified in the update statement which is used.
Usually with an expression like this:

IF NOT UPDATING('IS_CANCELED')
THEN
:new.is_canceled := ...;
END IF;

I have not found anything similar in PostgreSQL. What is the common approach to this problem?

BR
Dirk

--
Dirk Mika
Software Developer

mika:timing GmbH
Strundepark - Kürtener Str. 11b
51465 Bergisch Gladbach
Germany

fon +49 2202 2401-1197
dirk(dot)mika(at)mikatiming(dot)de
www.mikatiming.de

AG Köln HRB 47509 * WEEE-Reg.-Nr. DE 90029884
Geschäftsführer: Harald Mika, Jörg Mika

## 2020 - Das Jahr der Veränderungen
## https://now.mikatiming.de/story/2020-das-jahr-der-veraenderungen/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christophe Pettus 2021-01-01 16:05:26 Re: Trigger with conditional predicates
Previous Message Thorsten Schöning 2021-01-01 13:34:35 Re: How to REMOVE a fillfactor set by accident?