Re: pg_service.conf and client support

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Niels Jespersen <NJN(at)dst(dot)dk>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_service.conf and client support
Date: 2020-06-15 09:23:59
Message-ID: fed1dc21ad7fbf917fe1df5fadd1f371b6063286.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2020-06-15 09:31:29 Re: Oracle vs. PostgreSQL - a comment
Previous Message Laurenz Albe 2020-06-15 09:17:24 Re: TOAST table size in bytes growing despite working autovacuum