2017-07-05 16:29 GMT+02:00 Thomas Kellerer <spam_eater@xxxxxxx>:
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][/[ Besides the fact that something like that is already possible:dbname][/[[table[/[column[, column...]*]]]|sql]]]
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