Re: DISCARD ALL ; stored procedures - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: DISCARD ALL ; stored procedures
Date
Msg-id AANLkTi=9nAWzHFUSxBc9DTAjCz+ZqeMfpWtgLNV1k80s@mail.gmail.com
Whole thread Raw
In response to DISCARD ALL ; stored procedures  (Stephen Frost <sfrost@snowman.net>)
Responses Re: DISCARD ALL ; stored procedures  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
On Thu, Jan 6, 2011 at 3:20 PM, Stephen Frost <sfrost@snowman.net> wrote:
> Greetings,
>
>  Looking at discard all, I was a bit suprised that 'DISCARD PLANS;'
>  doesn't clear out cached stored procedures.  To be honest, that's one
>  of the main reasons I'd see to use it.  I thought there had been some
>  discussion in the archives related to invalidating stored procedure
>  plans due to catalog or other changes, I would have thought it'd be
>  possible to hook into that to do the same on a DISCARD PLANS;.
>
>  Thoughts?  Is there an issue doing that?  It certainly seems like it'd
>  be a lot better than what he current documentation requires:
>
>  When necessary, the cache can be flushed by starting a fresh database
>  session.
>
>  Maybe we could use 'DISCARD PLPLANS;' or something, if people feel
>  there needs to be a seperate way to clear those.

this is a problem. under what circumstances would you want to discard
them and why?  the main problem I see with cached plpgsql plans is
interactions with search_path -- but DISCARD might not be the best way
to attack that problem.  There might be other reasons though.

merlin


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Problem with pg_upgrade (8.4 -> 9.0) due to ALTER DATABASE SET ROLE
Next
From: Gurjeet Singh
Date:
Subject: Re: Patch to add a primary key using an existing index