Search Postgresql Archives

Re: Feature proposal, DBURL: psql pgsql://joe:p4zzw0rd@xxxxxxxxxxx:2345/dbname

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/05/2017 06:15 AM, Albe Laurenz wrote:
Hans Schou wrote:
The dburl (or dburi) has become common to use by many systems connecting to a database.
The feature is that one can pass all parameters in a string, which has similar pattern as
http-URI do.

Especially when using psql in a script, having the credentials in one string is
convenient.


The syntax could be:

[scheme[<+>dsn]]://[[username[:[password]]@][host][:port][/[dbname][/[[table[/[column[,col
umn...]*]]]|sql]]]


Example of usage:
   psql pgsql://joe:p4zzw0rd@xxxxxxxxxxx:2345/dbname

[...]

I have attached an example of how it could be implemented. It uses libpcre RegEx to pass
the dburl.

Unless I misunderstand, this has been in PostgreSQL since 9.2:

T think the OP was referring to the latter part of:

[scheme[<+>dsn]]://[[username[:[password]]@][host][:port][/[dbname][/[[table[/[column[,column...]*]]]|sql]]]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The thing is that in a quick search on this I did not find a reference implementation of this to compare against.


Yours,
Laurenz Albe



--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux