Re: psql timeout option

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: psql timeout option
Дата
Msg-id 11831e3c-b9a9-ae87-9452-33eee864987f@aklaver.com
обсуждение исходный текст
Ответ на psql timeout option  (Jesús Gómez <jgomo3@gmail.com>)
Список pgsql-general
On 6/17/19 8:59 AM, Jesús Gómez wrote:
> Hello!
> 
> Does the psql command have a timeout option for network connections?

Something like below? If not you will need to be more specific

https://www.postgresql.org/docs/11/app-psql.html

 From within psql:


\c or \connect

  \c "host=localhost port=5432 dbname=mydb connect_timeout=10 
sslmode=disable"


Borrowing from above for initial connection

psql "host=localhost port=5432 dbname=mydb connect_timeout=10 
sslmode=disable"

Where connect_timeout is:

https://www.postgresql.org/docs/11/libpq-connect.html#LIBPQ-CONNSTRING

"connect_timeout

     Maximum wait for connection, in seconds (write as a decimal 
integer, e.g. 10). Zero, negative, or not specified means wait 
indefinitely. The minimum allowed timeout is 2 seconds, therefore a 
value of 1 is interpreted as 2. This timeout applies separately to each 
host name or IP address. For example, if you specify two hosts and 
connect_timeout is 5, each host will time out if no connection is made 
within 5 seconds, so the total time spent waiting for a connection might 
be up to 10 seconds.
"



-- 
Adrian Klaver
adrian.klaver@aklaver.com



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

Предыдущее
От: Jesús Gómez
Дата:
Сообщение: psql timeout option
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Copy Bulk Ignore Duplicated