Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 2479D1337B58 for ; Tue, 12 Oct 2010 12:55:40 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 51138-06; Tue, 12 Oct 2010 15:55:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from fetter.org (mail.fetter.org [64.81.66.25]) by mail.postgresql.org (Postfix) with ESMTP id 81DF41337B59; Tue, 12 Oct 2010 12:55:32 -0300 (ADT) Received: by fetter.org (Postfix, from userid 500) id 2FBA2FBC57C; Tue, 12 Oct 2010 08:55:31 -0700 (PDT) Date: Tue, 12 Oct 2010 08:55:31 -0700 From: David Fetter To: Kevin Grittner Cc: rsmogura@softperience.eu, PG Hackers , PostgreSQL JDBC List Subject: Re: [JDBC] Support for JDBC setQueryTimeout, et al. Message-ID: <20101012155531.GB29627@fetter.org> References: <20101011064615.GJ29408@fetter.org> <4CB2CADC020000250003676B@gw.wicourts.gov> <88dcb3988805ede17af4a460ad251534@smogura-softworks.eu> <20101012141439.GA29627@fetter.org> <4CB43A4C0200002500036826@gw.wicourts.gov> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CB43A4C0200002500036826@gw.wicourts.gov> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/751 X-Sequence-Number: 171791 On Tue, Oct 12, 2010 at 10:37:00AM -0500, Kevin Grittner wrote: > David Fetter wrote: > > Is there something incomplete about the ones I sent, and if so, > > what? > > Well, I'm still curious why it was necessary to modify the server > side to implement an interface feature for which everything needed > seems to be present on the client side. Not everything is. Let's imagine you have a connection pooler with two clients, A and B. A calls setQueryTimeout, then starts a query, which terminates in time, but dies before handling it. B connects to the pool, gets A's connection, and finds a statement_timeout that's not the default, even though only A's single query was supposed to have that statement_timeout. This is not a situation that can be resolved without being able to set a timer *on the server side*. > Is this intended to be useful for other interfaces? Anybody doing similar functionality, namely a per-statement timeout, would need this infrastructure, and for the same reason. > If so, we should probably have an implementation in some other > interface to confirm that the server-side support fits. If not, why > touch the server side code at all? See above. While I'd *like* to put in a whole infrastructure for setting GUCs on a per-statement basis, I don't believe that we need to get out that giant sledgehammer for this case, even though it's worth solving. Incidentally, this dovetails neatly with the isolation concerns that motivated the "true serializability" patch you're working on :) Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fetter@gmail.com iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate