Skip site navigation (1) Skip section navigation (2)

Re: Implementing RESET CONNECTION ...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: Kris Jurka <books(at)ejurka(dot)com>, Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>,eg(at)cybertec(dot)at, pgsql-patches(at)postgresql(dot)org
Subject: Re: Implementing RESET CONNECTION ...
Date: 2005-01-04 01:27:44
Message-ID: 12095.1104802064@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Oliver Jowett <oliver(at)opencloud(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Oliver JowettDate: 2005-01-04 01:33:09
Subject: Re: Implementing RESET CONNECTION ...
Previous:From: Oliver JowettDate: 2005-01-04 01:20:44
Subject: Re: Implementing RESET CONNECTION ...

pgsql-patches by date

Next:From: Oliver JowettDate: 2005-01-04 01:33:09
Subject: Re: Implementing RESET CONNECTION ...
Previous:From: Oliver JowettDate: 2005-01-04 01:25:33
Subject: Re: Implementing RESET CONNECTION ...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group