pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: Robert Haas <robertmhaas@gmail.com>
To: Korry Douglas <korry.douglas@enterprisedb.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Patch (2): Implement failover on libpq connect level.
Date: Mon, 26 Oct 2015 16:28:28 -0400
Message-ID: <562E8CEC.5010702@gmx.net> (raw)
In-Reply-To: <CA+TgmoYrCaHamM6fOYmkBqL5hJ9VXufevgXX4dBKaUfiQuASeg@mail.gmail.com>
References: <20150818041850.GA5092@wagner.pp.ru>
	<20151014104151.GA6744@wagner.pp.ru>
	<20151021090722.GA7825@wagner.pp.ru>
	<562A9259.4060408@enterprisedb.com>
	<CA+TgmoYrCaHamM6fOYmkBqL5hJ9VXufevgXX4dBKaUfiQuASeg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 10/24/15 7:55 AM, Robert Haas wrote:
> On Fri, Oct 23, 2015 at 4:02 PM, Korry Douglas
> <korry.douglas@enterprisedb.com> wrote:
>> When you call pg_is_in_recovery(), you should schema-qualify the function
>> name, just in case some other version of that function exists in the
>> search_path.
> 
> I wonder whether it's really a good idea to put this kind of logic
> into libpq at all.  I think there was some previous votes against
> doing so, and I tend to agree with that viewpoint.  Shouldn't probing
> for the state of the connection be the caller's job, not libpq's?  If
> somebody wants to write a wrapper function around this that runs this
> query after connecting - or any other query - they can do so.

Well, earlier there was a debate whether any of this should be in libpq.

I think asking for a read-only or read-write connection would be quite
useful, and there isn't really a lot of room for interpretation that
would lead to a lot of application-specific implementations.

That said, it might still be best to omit this from the first round of
the patch, to simplify the discussion.




-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (10+ messages)

Message-ID: <562E8CEC.5010702@gmx.net>
Permalink:  ../562E8CEC.5010702@gmx.net/
Also on:    postgresql.org/message-id/562E8CEC.5010702@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: peter_e@gmx.net, robertmhaas@gmail.com, korry.douglas@enterprisedb.com, pgsql-hackers@postgresql.org
  Subject: Re: Patch (2): Implement failover on libpq connect level.
  In-Reply-To: <562E8CEC.5010702@gmx.net>
  References: <20150818041850.GA5092@wagner.pp.ru> <20151014104151.GA6744@wagner.pp.ru> <20151021090722.GA7825@wagner.pp.ru> <562A9259.4060408@enterprisedb.com> <CA+TgmoYrCaHamM6fOYmkBqL5hJ9VXufevgXX4dBKaUfiQuASeg@mail.gmail.com> <562E8CEC.5010702@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox