Search Postgresql Archives

Re: Requiring pass and database psql shell command

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

 



On Mon, Mar 5, 2018 at 5:55 AM, Łukasz Jarych <jaryszek@xxxxxxxxx> wrote:
Hi Guys,

do you have also problem that every time you have to log into your database using shell and psql?

I have to write over and over localhost, username, password...how to force shell to remember this?


​Use a service file.​

psql "service=mydb" -c "SELECT 1;"


I also, for scripts, simply define a function at the top of the script psql_* and invoke that function instead of psql directly.

I use .pgpass for passwords

David J.


[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