Search Postgresql Archives

Re: Can I trigger an action from a coalesce ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christophe Pettus <xof@xxxxxxxxxxxx> writes:
>> On Feb 22, 2020, at 14:02, Tom Lane <tgl@xxxxxxxxxxxxx> 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






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux