Re: Plan invalidation vs temp sequences
От | Tom Lane |
---|---|
Тема | Re: Plan invalidation vs temp sequences |
Дата | |
Msg-id | 12935.1192112281@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Plan invalidation vs temp sequences ("Florian G. Pflug" <fgp@phlo.org>) |
Ответы |
Re: Plan invalidation vs temp sequences
|
Список | pgsql-hackers |
"Florian G. Pflug" <fgp@phlo.org> 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* 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, short of an extra traversal of the query tree, which is pretty annoying/expensive for data that will probably never be needed for most queries. > Hm... couldn't this be worked around by doing > create or replace function dynamic_oid(text) returning regclass as > 'select $1::regclass' language 'pl/pgsql' stable; > And then writing > nextval(dynamic_oid('mysequence')). The cast-to-text workaround that I suggested does exactly that. regards, tom lane
В списке pgsql-hackers по дате отправления: