Re: Trigger with conditional predicates

Поиск
Список
Период
Сортировка
От Dirk Mika
Тема Re: Trigger with conditional predicates
Дата
Msg-id 2BC0544B-F37E-47C2-AC17-033C5B28A477@mikatiming.de
обсуждение исходный текст
Ответ на Re: Trigger with conditional predicates  (Alban Hertroys <haramrae@gmail.com>)
Ответы Re: Trigger with conditional predicates  (Alban Hertroys <haramrae@gmail.com>)
Список pgsql-general
--
Dirk Mika
Software Developer

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

fon +49 2202 2401-1197
dirk.mika@mikatiming.de
www.mikatiming.de

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


> > On 1 Jan 2021, at 16:56, Dirk Mika <Dirk.Mika@mikatiming.de> wrote:
> >
> > 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?

> Can't you use column defaults to handle these cases?

That would work for inserts, but not for updates.

BR
Dirk



В списке pgsql-general по дате отправления:

Предыдущее
От: Rad Akefirad
Дата:
Сообщение: Re: How to generate random string for all rows in postgres
Следующее
От: Dirk Mika
Дата:
Сообщение: Re: Trigger with conditional predicates