Re: [PATCH] Add support for postgres:// URIs to PGDATABASE environment variable - Mailing list pgsql-hackers

From Rémi Lapeyre
Subject Re: [PATCH] Add support for postgres:// URIs to PGDATABASE environment variable
Date
Msg-id E00DFD4D-20ED-4ECC-B5A0-A24F8EF637FC@lenstra.fr
Whole thread Raw
In response to Re: [PATCH] Add support for postgres:// URIs to PGDATABASE environment variable  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

> Le 17 avr. 2023 à 03:25, Tom Lane <tgl@sss.pgh.pa.us> a écrit :
> 
> You can do this:
> 
> $ psql -d "postgres://localhost/test"
> 
> but that's not the same thing as reinterpreting the dbname field
> of what we have already determined to be a connection string.
> 

Yes, I know see the difference, I got confused by the way the code reuses the dbname keyword to pass the connection
stringand the fact that 
 

$ psql --dbname "postgres://localhost/test"

works, but the dbname parameter of psql is not the same as the dbname used by libpq.


> Perhaps there is a case for inventing a new environment variable
> that can do what you're suggesting.  But you would have to make
> a case that it's worth doing, and also define how it interacts
> with all the other PGxxx environment variables.

I think it could be convenient to have such an environment variable but given your feedback I will just make it
specificto my application rather than a part of libpq.
 

Best,
Rémi

pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: eclg -C ORACLE breaks data
Next
From: Alvaro Herrera
Date:
Subject: Re: Add two missing tests in 035_standby_logical_decoding.pl