Re: DISCARD ALL (Again) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: DISCARD ALL (Again)
Date
Msg-id 24346.1397833581@sss.pgh.pa.us
Whole thread Raw
In response to Re: DISCARD ALL (Again)  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> On 4/17/14, 8:24 PM, Tom Lane wrote:
>> We could in fact implement #2, I imagine, by destroying and recreating
>> the entire language interpreter.  So I could imagine implementing a
>> "DISCARD INTERPRETERS" kind of command that would zap the current
>> interpreter(s) for whichever PL languages happened to feel like
>> cooperating with the command.

> More generally, any extension could maintain any kind of cross-call
> state.  plproxy, dblink, pgmemcache come to mind.  A general hook into
> DISCARD might be doable, but then it's not clear how to categorize this
> into DISCARD subcommands.

Right.  So if we go down that path, we're basically giving up the ability
to define what DISCARD ALL does by specifying an equivalent list of
subcommands.  Maybe that's an acceptable tradeoff, but I don't like it
much.

I wonder whether we could have a "DISCARD identifier" variant where
any hooked-in extension could recognize the identifier and zap some
appropriate subset of its own state.  This would get us to a situation
where we could say "DISCARD ALL is the union of all DISCARD operations,
but some of those are documented in relevant extensions' docs rather
than here".

The permissions problem remains, of course.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: assertion in 9.4 with wal_level=logical
Next
From: Robert Haas
Date:
Subject: Re: Clock sweep not caching enough B-Tree leaf pages?