Re: Implementing RESET CONNECTION ...

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kris Jurka <books(at)ejurka(dot)com>, Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>, eg(at)cybertec(dot)at, List pgsql-patches <pgsql-patches(at)postgreSQL(dot)org>
Subject: Re: Implementing RESET CONNECTION ...
Date: 2005-01-04 12:33:16
Message-ID: 41DA8D0C.701@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Karel Zak wrote:

> I still don't see a big difference between DEALLOCATE and RESET -- both
> can break the JDBC driver.

You have to go out of your way to break the driver via DEALLOCATE,
explicitly finding a statement name that the driver is using. There's
also a reasonably simple fix: make the protocol-level and
PREPARE/DEALLOCATE namespaces separate. There's been some discussion
about doing this in the past.

In contrast RESET CONNECTION, by design, resets many things without
needing to explicitly list them. The user could easily reset connection
state that a driver is relying on without realizing it.

> I think each PG command returns some status. For example in libpq it's
> possible check by PQcmdStatus(). I think JDBC can checks this status (by
> own PQcmdStatus() implementation) and if PG returns string "CONNECTION-
> RESETED" it can deallocate internal stuff. This solution doesn't require
> touch the protocol.

That could work. It's a bit ugly, though, as currently drivers don't
need to parse command status strings (unless they want an insert OID)

-O

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oliver Jowett 2005-01-04 12:36:16 Re: Implementing RESET CONNECTION ...
Previous Message Hannu Krosing 2005-01-04 10:59:14 Re: oldish libpq bug still in RC2

Browse pgsql-patches by date

  From Date Subject
Next Message Oliver Jowett 2005-01-04 12:36:16 Re: Implementing RESET CONNECTION ...
Previous Message Todd Kover 2005-01-04 12:30:02 Re: patch to add krb_server_hostname to postgresql.conf