Re: postgres connection with port option in shell script

Поиск
Список
Период
Сортировка
От Andreas Kretschmer
Тема Re: postgres connection with port option in shell script
Дата
Msg-id 9809d836-d598-0b5c-efad-5413d7e92c88@a-kretschmer.de
обсуждение исходный текст
Ответ на postgres connection with port option in shell script  (Abhra Kar <abhra.kar@gmail.com>)
Список pgsql-general

Am 14.02.2018 um 16:21 schrieb Abhra Kar:
>
> Hi,
>
>       I want to get postgres connection in script file. I am executing 
> below command and successfully getting connected ---
>
>
> psql postgresql://$USER:$PASSWORD@$HOST/$DATABASE <<END
>
>
> select * from abc;
>
>
> This is executing with default 5432 port.If postgres is installed to 
> any other port then port option need to be include here[Don't want to 
> take port from .pgpass file].
>
> How I can modify this command with PORT option.
>
>
> Thanks
>
>

   postgresql://[user[:password]@][netloc][:port][,...][/dbname][?param1=value1&...]


Rgards, Andreas

-- 
2ndQuadrant - The PostgreSQL Support Company.
www.2ndQuadrant.com



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

Предыдущее
От: Abhra Kar
Дата:
Сообщение: postgres connection with port option in shell script
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: postgres connection with port option in shell script