Re: Implementing RESET CONNECTION ... - Mailing list pgsql-patches

From Tom Lane
Subject Re: Implementing RESET CONNECTION ...
Date
Msg-id 12095.1104802064@sss.pgh.pa.us
Whole thread Raw
In response to Re: Implementing RESET CONNECTION ...  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: Implementing RESET CONNECTION ...
Re: Implementing RESET CONNECTION ...
List pgsql-patches
Oliver Jowett <oliver@opencloud.com> writes:
> Tom Lane wrote:
>> Maybe the RESET CONNECTION command
>> should have an option whether to zap prepared statements or not?

> That doesn't really help the JDBC driver case. The problem is that there
> are prepared statements that have been set up by the driver invisibly to
> the user. Zapping them will make the driver break, and it's too easy for
> the user code to do a full RESET CONNECTION and accidently zap them.

Fair point, but you could make the same argument against *any* side
effect of RESET CONNECTION.  You're just complaining about PREPARE
because you can see immediately where that breaks JDBC.  Anything that
any driver does to set up per-connection state the way it wants will
be equally vulnerable.

> Having notification of either prepared statement deallocation or
> connection reset (a la ParameterStatus for GUC changes) would help the
> driver to recover from this case.

I'm inclined to think that we'd have to add a protocol message that
reports RESET CONNECTION to really answer objections of this type.
That seems to bring the thing into the category of "stuff that forces
a protocol version bump" :-(

Perhaps RESET CONNECTION should be a protocol-level operation instead
of a SQL command?  That would prevent user-level code from causing it
without the driver knowing.

            regards, tom lane

pgsql-patches by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: Implementing RESET CONNECTION ...
Next
From: Oliver Jowett
Date:
Subject: Re: Implementing RESET CONNECTION ...