Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id F3AFBD84656 for ; Fri, 8 Jun 2012 10:47:37 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SczXL-0003VF-K1 for pgsql-jdbc@postgresql.org; Fri, 08 Jun 2012 13:47:37 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q58DlJSr011466; Fri, 8 Jun 2012 09:47:19 -0400 (EDT) From: Tom Lane To: Craig Ringer cc: "Johann 'Myrkraverk' Oskarsson" , PostgreSQL JDBC Subject: Re: get/setReadOnly broken if default_transaction_read_only on In-reply-to: <4FD1FA7F.4050400@ringerc.id.au> References: <4FCFB988.2080408@math.purdue.edu> <4FD08767.6000302@ringerc.id.au> <4FD1FA7F.4050400@ringerc.id.au> Comments: In-reply-to Craig Ringer message dated "Fri, 08 Jun 2012 21:13:35 +0800" Date: Fri, 08 Jun 2012 09:47:19 -0400 Message-ID: <11465.1339163239@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/29 X-Sequence-Number: 23023 Craig Ringer writes: > On 06/08/2012 04:19 PM, Johann 'Myrkraverk' Oskarsson wrote: >> Craig Ringer writes: >>> The JDBC driver really needs a way to grab everything it needs to know >>> efficiently during initial connection setup, with some extensibility >>> so connection parameters can specify other things to request and cache >>> when the connection is first established. > I was thinking more of running something like: > ... preferably combined with a mechanism for the server to notify (or > NOTIFY) the JDBC client when a pg_ctl reload or a SET causes settings to > change. Running pg_settings() seems like a dead end to me, precisely because you won't know about any subsequent changes; and most of the parameters that JDBC might care about are changeable. LISTEN/NOTIFY is not the answer either, for the reasons you mention as well as some others. There already is a mechanism to notify clients of changes in selected GUC settings, but currently the set of parameters so reported is hard-wired. Possibly pgsql-hackers would consider a proposal to let the GUC_REPORT flag get set on client-selected parameters. regards, tom lane