Re: Plan invalidation vs temp sequences
| От | Heikki Linnakangas |
|---|---|
| Тема | Re: Plan invalidation vs temp sequences |
| Дата | |
| Msg-id | 470DD45C.3060706@enterprisedb.com обсуждение исходный текст |
| Ответ на | Plan invalidation vs temp sequences (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-hackers |
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 sequences seems a bit narrow and there are several workarounds
> (see followups to bug report), so I'm feeling this is a
> fix-some-other-day kind of issue.
Agreed. I was a bit worried about this kind of usage:
CREATE OR REPLACE FUNCTION testfunc(val int) RETURNS int AS $$
DECLARE
BEGIN CREATE TEMPORARY SEQUENCE tempseq; CREATE TEMPORARY TABLE inttable (key integer DEFAULT
nextval('tempseq'), data text); INSERT INTO inttable (data) VALUES ('foo'); DROP TABLE inttable; DROP SEQUENCE tempseq;
return1;
END;
$$ LANGUAGE plpgsql;
but that seems to work, because creating/dropping the temp table
triggers the plan invalidation.
-- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com
В списке pgsql-hackers по дате отправления: