Re: [GENERAL] Re: Feature proposal, DBURL: psql pgsql://joe:p4zzw0rd@example.org:2345/dbname - Mailing list pgsql-general

From Hans Schou
Subject Re: [GENERAL] Re: Feature proposal, DBURL: psql pgsql://joe:p4zzw0rd@example.org:2345/dbname
Date
Msg-id CAApBw36PW9EP9bkrxh7Pw3=T9zgAq5aObreKMWudoFav2d6+xQ@mail.gmail.com
Whole thread Raw
In response to [GENERAL] Re: Feature proposal, DBURL: psqlpgsql://joe:p4zzw0rd@example.org:2345/dbname  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-general
2017-07-05 16:29 GMT+02:00 Thomas Kellerer <spam_eater@gmx.net>:
Hans Schou schrieb am 05.07.2017 um 14:27:
> 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[,column...]*]]]|sql]]]

Besides the fact that something like that is already possible:

What's the use of "table" and "column" in the URI? You connect to a database, not to a table.

With 'table' the idea was  to do a "SELECT * FROM table" on that.
With 'column' added only that or those columns would be listed.

The "sql" part in the end was supposed to be a SQL-statement to be executed, like:
  psql "postgresql://localhost/dbname/INSERT INTO foo VALUES($RANDOM)"
which should be equal to
  echo "INSERT INTO foo VALUES($RANDOM)" | psql postgresql://localhost/dbname

./hans

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: [GENERAL] building extension with large string inserts
Next
From: Moreno Andreo
Date:
Subject: Re: [SPAM] Re: [GENERAL] Invalid field size