Re: Plan invalidation vs temp sequences - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Plan invalidation vs temp sequences
Date
Msg-id 470DD45C.3060706@enterprisedb.com
Whole thread Raw
In response to Plan invalidation vs temp sequences  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: "Marko Kreen"
Date:
Subject: Re: Skytools committed without hackers discussion/review
Next
From: "Brendan Jurd"
Date:
Subject: Re: quote_literal with NULL