Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jklLa-0004F9-TP for pgsql-general@arkaria.postgresql.org; Mon, 15 Jun 2020 09:24:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jklLZ-0004Xo-GF for pgsql-general@arkaria.postgresql.org; Mon, 15 Jun 2020 09:24:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jklLZ-0004Xh-8E for pgsql-general@lists.postgresql.org; Mon, 15 Jun 2020 09:24:05 +0000 Received: from mail-ej1-x642.google.com ([2a00:1450:4864:20::642]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jklLW-0008RH-Ol for pgsql-general@postgresql.org; Mon, 15 Jun 2020 09:24:04 +0000 Received: by mail-ej1-x642.google.com with SMTP id q19so16629510eja.7 for ; Mon, 15 Jun 2020 02:24:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=Zvm6tnw9cOlyg8LhSFs1bWUKQMRV5BP0q0Dyk681vks=; b=QHUqIuRJE3XiGz3EtDZ34QhZ3P1o6KkKFGVhPLCbnwNi9BxhsEv801VlH6RLkKANLl KppahYirZnl+eJ2kzuYcJvI52mxhdIpvfJQmpqfY+pfCwBdK713+k7m7hHKcGVuUBbOW UJyjPayoe/GwP8G9q4V8JgEaKBEGWaYoQTNWp7KLAu9JW8I/BdlnUeqHm1FgC+o+jxaL GkleBHyyGvenKocHWyBRcVanjPzXVe/7B5e6ayK5TGr0pC2khMf7FQwojjRvw2jTB4P2 OqHPt1JzL6GJBXD0XtQ9/9PuUMU+0smYjdXRl8kAypxdBNwckVahMULPUK5hH3zfVGyb gIiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=Zvm6tnw9cOlyg8LhSFs1bWUKQMRV5BP0q0Dyk681vks=; b=bPlySJDipc4alZMkS2Cl97qa8OdtwDl07U3l1rpFS6Yq2J2ehhiiMCuoEvfI9vlnqw U4fhTe3RBIv3EZaybVnXBxZaXRY+KqAB36JcJDGr2rI4je0St4FKwQT06D6peIbaJaUI gkuyhUW4Ji75oTmfZh4DRLyE3M2DrXDwtN2AW2WCVbtwRSYXVF2XpLZkaeJ3Zaqatye5 QmiV6LW2WYsxZAxWvEhMz+mrXXYxrtieUci4UqOuqOwTjKhazIE0ZSSb4apvOPcWaGBJ c/s9UqwbJXF1mJRWMfw3LHEVtIP/iZGQsl+OmFMZ6a7dLssMrWZAPFJfDkb3z+RwL5N/ 7U3w== X-Gm-Message-State: AOAM53050l8AOAEhCIgHypIbt1/7YzMjKAy2G8pAxnW3EO+ToMovi11C uL2Sl7VTgAd+pP7bpnO0jxyFvw== X-Google-Smtp-Source: ABdhPJyzyJSuFYcz+aaC5N2BMSXDuppqFrsFj4XZAwB5CZodeD/ItcO6Qtn4S0yEGD5MLH38qgpNGg== X-Received: by 2002:a17:907:35c9:: with SMTP id ap9mr23839913ejc.81.1592213041240; Mon, 15 Jun 2020 02:24:01 -0700 (PDT) Received: from localhost.localdomain (217-149-168-120.nat.highway.telekom.at. [217.149.168.120]) by smtp.gmail.com with ESMTPSA id u13sm8686216ejf.60.2020.06.15.02.24.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 02:24:00 -0700 (PDT) Message-ID: Subject: Re: pg_service.conf and client support From: Laurenz Albe To: Niels Jespersen , "pgsql-general@postgresql.org" Date: Mon, 15 Jun 2020 11:23:59 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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