pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Niels Jespersen <NJN@dst.dk>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: pg_service.conf and client support
Date: Mon, 15 Jun 2020 11:23:59 +0200
Message-ID: <fed1dc21ad7fbf917fe1df5fadd1f371b6063286.camel@cybertec.at> (raw)
In-Reply-To: <c5b02f3be97c48159508bf5e85b3f11a@dst.dk>
References: <c5b02f3be97c48159508bf5e85b3f11a@dst.dk>

On Sun, 2020-06-14 at 05:03 +0000, Niels Jespersen wrote:
> I just found out about the pg service file. https://www.postgresql.org/docs/current/libpq-pgservice.html
> 
> I don’t know why it took me so long finding this. I have been looking for ways to abstract physical details of data location away for clients (much like Oracle’s tnsnames).
> 
> Want to move a cluster to a new host. Sure, move it, edit pg_service.conf and clients will not know the difference.
> 
> It works great for at least psql and psycopg2.
> 
> But I cannot find anything on pg_service.conf and the Postgres ODBC driver and Npgsql for .Net
> 
> I know pg_service.conf support is implemented through libpq and support for rivers not using libpq is not a given thing.
> 
> But I think the need for the abstraction of connection details is a general one.
> 
> Can anyone shed som light on the ubiquitousness of support for pg_service.conf?

You got it right: pg_service.conf is only used by libpq, so all clients that
use libpq automatically support it.  Other clients don't support it.

For your examples that means:
- The PostgreSQL ODBC server can use pg_service.conf
- NpgSQL cannot use the file.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






view thread (4+ messages)

Message-ID: <fed1dc21ad7fbf917fe1df5fadd1f371b6063286.camel@cybertec.at>
Permalink:  ../fed1dc21ad7fbf917fe1df5fadd1f371b6063286.camel@cybertec.at/
Also on:    postgresql.org/message-id/fed1dc21ad7fbf917fe1df5fadd1f371b6063286.camel@cybertec.at

 · 

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-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, NJN@dst.dk
  Subject: Re: pg_service.conf and client support
  In-Reply-To: <fed1dc21ad7fbf917fe1df5fadd1f371b6063286.camel@cybertec.at>
  References: <c5b02f3be97c48159508bf5e85b3f11a@dst.dk> <fed1dc21ad7fbf917fe1df5fadd1f371b6063286.camel@cybertec.at>

* 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