immutable function calling stable function

Hi,

shouldn't it be illegal for an immutable function to call a stable one?

--
Markus Bertheau <twanger [at] bluetwanger.de>


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo [at] postgresql.org so that your
message can get through to the mailing list cleanly
twanger [ Mi, 21 Juli 2004 16:04 ] [ ID #453040 ]

Re: immutable function calling stable function

Markus Bertheau <twanger [at] bluetwanger.de> writes:
> shouldn't it be illegal for an immutable function to call a stable one?

No, because that's the standard hack for getting around it when you wish
to call a stable function in what you know to be a "safe" way. If you
look in the archives you'll find cases where creating an immutable
wrapper function was the recommended solution to performance problems.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
tgl [ Mi, 21 Juli 2004 16:45 ] [ ID #453043 ]

Re: immutable function calling stable function

On Wed, 21 Jul 2004, Markus Bertheau wrote:

> shouldn't it be illegal for an immutable function to call a stable one?

It's expected that the function's creator is responsible for properly
marking its stability. This allows some flexibility when you know more
than the system does (for example, a stable function that isn't immutable
because of its use of a GUC variable being called from a function that
sets said variable).

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
sszabo [ Mi, 21 Juli 2004 16:51 ] [ ID #453044 ]
Datenbanken » comp.databases.postgresql.sql » immutable function calling stable function

Vorheriges Thema: MySQL-style "create temporary table foo select ..."
Nächstes Thema: Inherited tables and new fields