Re: Can I trigger an action from a coalesce ?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Can I trigger an action from a coalesce ?
Дата
Msg-id 8812.1582410974@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Can I trigger an action from a coalesce ?  (Christophe Pettus <xof@thebuild.com>)
Ответы Re: Can I trigger an action from a coalesce ?  (Christophe Pettus <xof@thebuild.com>)
Список pgsql-general
Christophe Pettus <xof@thebuild.com> writes:
>> On Feb 22, 2020, at 14:02, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> It's a really bad idea to mark a function that has side-effects
>> (i.e., emitting a NOTICE) as immutable, especially if the occurrence
>> of the side-effect at well-defined times is exactly what you're
>> desirous of.

> True, and it doesn't actually need to be immutable here; just cut and pasted from the wrong example.

> (That being said, I'm not coming up with a specific bad thing that a RAISE NOTICE in an immutable function will
cause. Is there one?) 

The problem that I'm worried about is premature evaluation of the
"immutable" function, causing the NOTICE to come out once during
query planning, independently of whether/how many times it should
come out during execution.

            regards, tom lane



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

Предыдущее
От: "Peter J. Holzer"
Дата:
Сообщение: Re: Cannot connect to postgresql-11 from another machine after boot
Следующее
От: "Andrus"
Дата:
Сообщение: How to get error message details from libpq based psqlODBC driver (regression)