Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 117961337B8F for ; Tue, 12 Oct 2010 16:29:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 19482-09 for ; Tue, 12 Oct 2010 19:29:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 502011337B49 for ; Tue, 12 Oct 2010 16:29:36 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o9CJTZhQ004984; Tue, 12 Oct 2010 15:29:35 -0400 (EDT) To: David Fetter cc: Kevin Grittner , rsmogura@softperience.eu, PG Hackers , PostgreSQL JDBC List Subject: Re: [JDBC] Support for JDBC setQueryTimeout, et al. In-reply-to: <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> <20101012155531.GB29627@fetter.org> Comments: In-reply-to David Fetter message dated "Tue, 12 Oct 2010 08:55:31 -0700" Date: Tue, 12 Oct 2010 15:29:35 -0400 Message-ID: <4983.1286911775@sss.pgh.pa.us> From: Tom Lane 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/759 X-Sequence-Number: 171799 David Fetter writes: > 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*. Actually, that seems like a fine argument why this should *not* be implemented on the server side... although I would expect a connection pooler to roll back GUC changes when switching users, so the argument seems to presume several rather broken implementation decisions in order to make the scenario possible. > 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. You'd need to first convince people that SET LOCAL doesn't solve the problem well enough already. regards, tom lane