OK, it seems I had some progress sanEtising my interactions with postgres and psql, its sql shell.
Once I create a database and a database user I no longer need to use the "postgres" linux account to run commands via su thanks to the "service file". This is a simple configuration file which holds dbname, dbuser, pass etc.:
# located at x/y/z.config [myservice] host= port= # above 2 can be left empty to denote unix socket connection dbname=... user=... password=...
And then PGSERVICEFILE=x/y/z.config psql 'service=myservice'
I have also found that psql accepts a connection string like: sql 'postgresql://mydbuser:mypassword@host:port/mydbname' (host, port are optional, leave empty for unix socket connection)
In reply to Re^6: Database access and async web framework (like Mojolicious)
by bliako
in thread Database access and async web framework (like Mojolicious)
by bliako
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |