pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
fully qualified domain names and .pgpass
5+ messages / 4 participants
[nested] [flat]

* fully qualified domain names and .pgpass
@ 2022-10-04 17:02  Ron <ronljohnsonjr@gmail.com>
  0 siblings, 3 replies; 5+ messages in thread

From: Ron @ 2022-10-04 17:02 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org


Sometimes (both interactively and via script) I access a remote Pg server 
via just the bare host name "foobar", and other times via the FQDN 
"foobar.example.com".

I've only been able to get this to work by having two lines in the .pgpass file:

foobar:5432:postgres:Allegedly.Strong.Password
foobar.example.com:5432:postgres:Allegedly.Strong.Password

But I'd rather have only one line.  Is there any way to do that?

-- 
Angular momentum makes the world go 'round.





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: fully qualified domain names and .pgpass
@ 2022-10-04 17:33  Alvaro Herrera <alvherre@alvh.no-ip.org>
  parent: Ron <ronljohnsonjr@gmail.com>
  2 siblings, 1 reply; 5+ messages in thread

From: Alvaro Herrera @ 2022-10-04 17:33 UTC (permalink / raw)
  To: Ron <ronljohnsonjr@gmail.com>; +Cc: pgsql-general@lists.postgresql.org

On 2022-Oct-04, Ron wrote:

> Sometimes (both interactively and via script) I access a remote Pg server
> via just the bare host name "foobar", and other times via the FQDN
> "foobar.example.com".
> 
> I've only been able to get this to work by having two lines in the .pgpass file:

Maybe it would be simpler to do this using a service definition in the
~/.pg_service.conf file.
https://www.postgresql.org/docs/current/libpq-pgservice.html

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: fully qualified domain names and .pgpass
@ 2022-10-04 17:34  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: Ron <ronljohnsonjr@gmail.com>
  2 siblings, 0 replies; 5+ messages in thread

From: Adrian Klaver @ 2022-10-04 17:34 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

On 10/4/22 10:02 AM, Ron wrote:
> 
> Sometimes (both interactively and via script) I access a remote Pg 
> server via just the bare host name "foobar", and other times via the 
> FQDN "foobar.example.com".
> 
> I've only been able to get this to work by having two lines in the 
> .pgpass file:
> 
> foobar:5432:postgres:Allegedly.Strong.Password
> foobar.example.com:5432:postgres:Allegedly.Strong.Password
> 
> But I'd rather have only one line.  Is there any way to do that?

Would a service file:

https://www.postgresql.org/docs/14/libpq-pgservice.html

work?

-- 
Adrian Klaver
adrian.klaver@aklaver.com







^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: fully qualified domain names and .pgpass
@ 2022-10-04 19:21  Jeffrey Walton <noloader@gmail.com>
  parent: Ron <ronljohnsonjr@gmail.com>
  2 siblings, 0 replies; 5+ messages in thread

From: Jeffrey Walton @ 2022-10-04 19:21 UTC (permalink / raw)
  To: Ron <ronljohnsonjr@gmail.com>; +Cc: pgsql-general@lists.postgresql.org

On Tue, Oct 4, 2022 at 1:02 PM Ron <ronljohnsonjr@gmail.com> wrote:
>
> Sometimes (both interactively and via script) I access a remote Pg server
> via just the bare host name "foobar", and other times via the FQDN
> "foobar.example.com".
>
> I've only been able to get this to work by having two lines in the .pgpass file:
>
> foobar:5432:postgres:Allegedly.Strong.Password
> foobar.example.com:5432:postgres:Allegedly.Strong.Password
>
> But I'd rather have only one line.  Is there any way to do that?

This is not a FQDN:

> "foobar.example.com".

A FQDN ends in dot '.' The dot denotes the top of the dns tree. So a
FQDN for the host would be:

    foobar.example.com.

Anyone who tells you any different has not read W. Richard Stevens :)

Jeff





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: fully qualified domain names and .pgpass
@ 2022-10-04 23:58  Ron <ronljohnsonjr@gmail.com>
  parent: Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Ron @ 2022-10-04 23:58 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

On 10/4/22 12:33, Alvaro Herrera wrote:
> On 2022-Oct-04, Ron wrote:
>
>> Sometimes (both interactively and via script) I access a remote Pg server
>> via just the bare host name "foobar", and other times via the FQDN
>> "foobar.example.com".
>>
>> I've only been able to get this to work by having two lines in the .pgpass file:
> Maybe it would be simpler to do this using a service definition in the
> ~/.pg_service.conf file.
> https://www.postgresql.org/docs/current/libpq-pgservice.html

That did solve my problem:
pg_backrest --dbname=service=basebackup

-- 
Angular momentum makes the world go 'round.





^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2022-10-04 23:58 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-10-04 17:02 fully qualified domain names and .pgpass Ron <ronljohnsonjr@gmail.com>
2022-10-04 17:33 ` Alvaro Herrera <alvherre@alvh.no-ip.org>
2022-10-04 23:58   ` Ron <ronljohnsonjr@gmail.com>
2022-10-04 17:34 ` Adrian Klaver <adrian.klaver@aklaver.com>
2022-10-04 19:21 ` Jeffrey Walton <noloader@gmail.com>

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