Re: DISCARD ALL (Again)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: DISCARD ALL (Again)
Date: 2014-04-18 15:06:21
Message-ID: 24346.1397833581@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-04-18 15:14:58 Re: Clock sweep not caching enough B-Tree leaf pages?
Previous Message Alvaro Herrera 2014-04-18 15:03:03 Re: assertion in 9.4 with wal_level=logical