Re: Boolean error - Mailing list pgsql-general

From Greg Stark
Subject Re: Boolean error
Date
Msg-id 874qj9uqjm.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Boolean error  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane <tgl@sss.pgh.pa.us> writes:

> There was some talk awhile ago of preventing flattening when the
> subquery targetlist contains volatile functions, but we didn't
> have any consensus that the cure would be better than the disease.
> (In particular, since user-defined functions default to being
> considered volatile, such a restriction could easily cripple
> optimization of subqueries.)

Thinking aloud... Postgres could have a VOLATILE function attribute to
explicitly mark functions requiring special care.

The default could be sort of a best-guess
usually-volatile-but-sometimes-takes-liberties-when-convenient compromise.
Perhaps eventually warning on functions created without being explicitly
VOLATILE/STABLE/IMMUTABLE.

Well, I guess Postgres can't warn on a valid SQL function if it's interested
in spec conformance. But it could be an option to do so.

--
greg

pgsql-general by date:

Previous
From: Shachar Shemesh
Date:
Subject: Re: sequencing two tables
Next
From: Michael Fuhr
Date:
Subject: Re: How many views...