Re: Delaying the planning of unnamed statements until Bind - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Delaying the planning of unnamed statements until Bind
Date
Msg-id 27907.1087218902@sss.pgh.pa.us
Whole thread Raw
In response to Re: Delaying the planning of unnamed statements until Bind  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: Delaying the planning of unnamed statements until Bind
List pgsql-hackers
Oliver Jowett <oliver@opencloud.com> writes:
> I guess that ExprState does not live long enough to be useful.

Actually the opposite: it lasts too long, namely the entire execution of
a query.  I don't think there's any convenient way to reset it on the
timescale appropriate for STABLE values (ie, once per scan, as opposed
to once per query).

> How about introducing a function modifier that provides stronger 
> guarantees than STABLE, along the lines of "immutable during execution 
> of a single SQL statement"?

Why?

I suspect that if we did have two flavors of STABLE, we'd just have a
lot of people getting it wrong :-(.  A big advantage of the current
definition is exactly that it is pretty weak...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Releasing 7.4.3 ...
Next
From: Tom Lane
Date:
Subject: Re: Weird 'bit' type behaviour