Re: SetQuerySnapshot, once again

From: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: SetQuerySnapshot, once again
Date: 2002-06-20 01:38:27
Message-ID: 3D113213.382F728C@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
>
> Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp> writes:
> >> I do not like the idea of treating the first select in a function
> >> differently from the rest. And such a rule wouldn't let you build
> >> guaranteed-stable functions anyway;
>
> > AFAIK there has been no analysis where we can get *stable*
> > functions. As far as I see, we can expect SELECT-only functions
> > to be *stable* if and only if they are surrounded by SELECT-only
> > *stable* functions.

Oops I was wrong. The last *stable* isn't needed.

> This idea might be a bit off-the-wall,

Probably I mentioned once long before.
We can't expect reasonable result for
select fn1(..), fn2(..), ... from ... ;
if there are some fnx()-s with strong side effect.

> but how about:
>
> 1. If a plpgsql function is declared immutable or stable, then all its
> queries run with the same snapshot *and* CommandCounterId as prevail
> in the calling query.

IMHO it's impossible to handle anything with one concept.
Functions could be *immutable*(? deterministic in SQL99)
or *stable* even though they have strong side effect.

regards,
Hiroshi Inoue
http://w2422.nsk.ne.jp/~inoue/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ryan Mahoney 2002-06-20 02:07:50 Re: count and group by question
Previous Message Thomas Lockhart 2002-06-20 01:23:24 Re: ecpg and bison again