Feature proposal, DBURL: psql pgsql://joe:p4zzw0rd@example.org:2345/dbname

From: Hans Schou <hans(dot)schou(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Feature proposal, DBURL: psql pgsql://joe:p4zzw0rd@example.org:2345/dbname
Date: 2017-07-05 12:27:02
Message-ID: CAApBw34VHuW3KjKMfRqFqJ9r8N8+vOte2kphXmxpKiFTS+oC4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

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]](at)][host][:port][/[dbname][/[[table[/[column[,column...]*]]]|sql]]]

Example of usage:
psql pgsql://joe:p4zzw0rd(at)example(dot)org:2345/dbname

Where
Scheme: pgsql
Username: joe
Password: p4zzw0rd
Host: example.org
Port: 2345
Database: dbname

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

best regards
Hans

Attachment Content-Type Size
dburl.diff text/plain 9.4 KB

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Devrim Gündüz 2017-07-05 12:34:10 Re: [ADMIN] How to install pgadmin3 or pgadmin4 on linux machine
Previous Message PAWAN SHARMA 2017-07-05 12:25:38 Re: [SPAM] How to install pgadmin3 or pgadmin4 on linux machine