On 04/17/2014 05:24 PM, Tom Lane wrote:
> "Joshua D. Drake" <jd@commandprompt.com> writes:
>> Does it seem reasonable based on the docs:
>> DISCARD ALL:
>> Releases all temporary resources associated with the current session and
>> resets the session to its initial state.
>> That we should also release the GD?
>
> There are a couple of reasons why this isn't anywhere near as
> open-and-shut as you seem to think:
>
> 1. The things that DISCARD ALL resets are explicitly enumerated in its
> documentation page; it is not an open-ended promise to clean up anything
> anybody happens to think of.
Actually, it is. Unless we change the wording in the documentation
because right now, DISCARD ALL states that it will return the session
back to its initial state. It does not do that.
[... snipping technical details for those who would be better at arguing
than I ... ]
>
> On the whole I'm not sure this is something we ought to get into.
> If you really need a fresh session, maybe you should start a
> fresh session.
This isn't nearly as simple as it sounds. That said, the work around we
came up with was to have server_reset_query in pg_bouncer call a
function called discard_gd() that explicitly discards the GD for that
session.
> But if we are going to get into it, I think the
> permissions aspect needs some careful thought.
>
Agreed.
Sincerely,
JD
--
Command Prompt, Inc. - http://www.commandprompt.com/ 509-416-6579
PostgreSQL Support, Training, Professional Services and Development
High Availability, Oracle Conversion, Postgres-XC, @cmdpromptinc
Political Correctness is for cowards.