Re: Requiring pass and database psql shell command

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Requiring pass and database psql shell command
Дата
Msg-id CAKFQuwZfLK8K9M80YW_awa9FBqQV6PkGGcbsnrUQuW6cRS75aw@mail.gmail.com
обсуждение исходный текст
Ответ на Requiring pass and database psql shell command  (Łukasz Jarych <jaryszek@gmail.com>)
Список pgsql-general
On Mon, Mar 5, 2018 at 5:55 AM, Łukasz Jarych <jaryszek@gmail.com> 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.

В списке pgsql-general по дате отправления:

Предыдущее
От: Martin Moore
Дата:
Сообщение: Re: What is wrong with my pgadmin?
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: psql variables in the DO command