Re: [HACKERS] Plan invalidation vs temp sequences

2007-10-19 Thread Florian G. Pflug
Gregory Stark wrote: "Tom Lane" <[EMAIL PROTECTED]> writes: There doesn't seem to be any very nice way to fix this. There is not any existing support mechanism (comparable to query_tree_walker) for scanning whole plan trees, which means that searching a cached plan for regclass Consts is going

Re: [HACKERS] Plan invalidation vs temp sequences

2007-10-11 Thread Tom Lane
I wrote: > Well, we *have* the sequence's Oid in the regclass constant, the problem > is the difficulty of digging through the plan tree to find it. I did > consider having the planner extract it and save it aside somewhere, but > there doesn't seem to be any very convenient place to do that, shor

Re: [HACKERS] Plan invalidation vs temp sequences

2007-10-11 Thread Tom Lane
"Florian G. Pflug" <[EMAIL PROTECTED]> writes: > Gregory Stark wrote: >> Given that sequences are in fact relations is there some way to work around >> the issue at least in this case by stuffing the sequence's relid someplace >> which the plan invalldation code can check for it? Well, we *have* t

Re: [HACKERS] Plan invalidation vs temp sequences

2007-10-11 Thread Florian G. Pflug
Gregory Stark wrote: "Tom Lane" <[EMAIL PROTECTED]> writes: There doesn't seem to be any very nice way to fix this. There is not any existing support mechanism (comparable to query_tree_walker) for scanning whole plan trees, which means that searching a cached plan for regclass Consts is going

Re: [HACKERS] Plan invalidation vs temp sequences

2007-10-11 Thread Gregory Stark
"Tom Lane" <[EMAIL PROTECTED]> writes: > There doesn't seem to be any very nice way to fix this. There is > not any existing support mechanism (comparable to query_tree_walker) > for scanning whole plan trees, which means that searching a cached plan > for regclass Consts is going to involve a ch

Re: [HACKERS] Plan invalidation vs temp sequences

2007-10-11 Thread Heikki Linnakangas
Tom Lane wrote: > ... We might want to do that someday --- in particular, > if we ever try to extend the plan inval mechanism to react to > redefinitions of non-table objects, we'd likely need some such thing > anyway. I'm disinclined to try to do it for 8.3 though. The use-case > for temp sequen

[HACKERS] Plan invalidation vs temp sequences

2007-10-10 Thread Tom Lane
In bug #3662 http://archives.postgresql.org/pgsql-bugs/2007-10/msg00047.php we see that it doesn't work to do nextval('seq') on a temp sequence in a plpgsql function except via EXECUTE, because the sequence OID gets embedded into the cached plan, same as any other temp table. This is to be expect