Re: Implementing RESET CONNECTION ...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: 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 00:56:53
Message-ID: 11856.1104800213@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Kris Jurka <books(at)ejurka(dot)com> writes:
> On Thu, 30 Dec 2004, [ISO-8859-1] Hans-Jrgen Schnig wrote:
>> We have implemented a patch which can be used by connection pools for
>> instance. RESECT CONNECTION cleans up a backend so that it can be
>> reused. Temp tables, LISTEN / NOTIFY stuff, WITH HOLD cursors, open
>> transactions, prepared statements and GUCs are cleaned up. I hope we
>> have not missed important per-backend information.

> From the JDBC driver's perspective this doesn't meet the needs I'd like to
> see in a connection reset. In the initial connection setup a number of
> GUC variables are tweaked to what the JDBC driver desires (DateStyle,
> client_encoding). When resetting we'd want to reset to this point, not
> the default values.

I haven't looked at the proposed patch, but I would've expected that it
duplicates the existing RESET ALL behavior for GUC settings. And that
already works the way you want. Values taken from the client connection
request packet establish the session defaults, ie, what RESET goes to.

> Also I don't like the idea of cleaning up prepared statements.

Hmm. This seems a bit eye-of-the-beholder-ish, ie you could make a
legitimate argument either way. Maybe the RESET CONNECTION command
should have an option whether to zap prepared statements or not?
Is there anything else falling in the category of "debatable"?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oliver Jowett 2005-01-04 01:20:44 Re: Implementing RESET CONNECTION ...
Previous Message Gaetano Mendola 2005-01-04 00:50:11 Re: uptime() for postmaster

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-01-04 01:03:29 Re: patch to add krb_server_hostname to postgresql.conf
Previous Message Bruce Momjian 2005-01-04 00:42:55 Re: uptime function to postmaster