SV: pg_service.conf and client support - Mailing list pgsql-general

From Niels Jespersen
Subject SV: pg_service.conf and client support
Date
Msg-id af544aa97f5e4ba380a4a9af5efe103f@dst.dk
Whole thread Raw
In response to Re: pg_service.conf and client support  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: SV: pg_service.conf and client support  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-general

-----Oprindelig meddelelse-----
Fra: Laurenz Albe <laurenz.albe@cybertec.at> 
Sendt: 15. juni 2020 11:24
Til: Niels Jespersen <NJN@dst.dk>; pgsql-general@postgresql.org
Emne: Re: pg_service.conf and client support

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
locationaway 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
clientsdon'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

Thank you Laurenz

You mention that the PostgreSQL ODBC driver can use pg_service.conf. But I cannot find any examples om how to construct
aconnectionstring that PostgreSQL ODBC will accept? 
 

Regards Niels




pgsql-general by date:

Previous
From: Kristjan Mustkivi
Date:
Subject: Re: TOAST table size in bytes growing despite working autovacuum
Next
From: Peter
Date:
Subject: Re: Something else about Redo Logs disappearing