keepliaves etc. as environment variables

Started by Tatsuo Ishiiabout 4 years ago4 messages
#1Tatsuo Ishii
ishii@sraoss.co.jp

It seems there are no environment variables corresponding to keepalives
etc. connection parameters in libpq. Is there any reason for this?

Best reagards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp

#2Andres Freund
andres@anarazel.de
In reply to: Tatsuo Ishii (#1)
Re: keepliaves etc. as environment variables

Hi,

On 2021-12-03 10:28:34 +0900, Tatsuo Ishii wrote:

It seems there are no environment variables corresponding to keepalives
etc. connection parameters in libpq. Is there any reason for this?

PGOPTIONS='-c tcp_keepalive_*=foo' should work.

Greetings,

Andres Freund

#3Tatsuo Ishii
ishii@sraoss.co.jp
In reply to: Andres Freund (#2)
Re: keepliaves etc. as environment variables

Hi,

On 2021-12-03 10:28:34 +0900, Tatsuo Ishii wrote:

It seems there are no environment variables corresponding to keepalives
etc. connection parameters in libpq. Is there any reason for this?

PGOPTIONS='-c tcp_keepalive_*=foo' should work.

Sorry I was not clear. I wanted to know why there are no specific
environment variable for keepalives etc. like PGCONNECT_TIMEOUT.

Best reagards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp

#4Robert Haas
robertmhaas@gmail.com
In reply to: Tatsuo Ishii (#3)
Re: keepliaves etc. as environment variables

On Thu, Dec 2, 2021 at 8:59 PM Tatsuo Ishii <ishii@sraoss.co.jp> wrote:

On 2021-12-03 10:28:34 +0900, Tatsuo Ishii wrote:

It seems there are no environment variables corresponding to keepalives
etc. connection parameters in libpq. Is there any reason for this?

PGOPTIONS='-c tcp_keepalive_*=foo' should work.

Sorry I was not clear. I wanted to know why there are no specific
environment variable for keepalives etc. like PGCONNECT_TIMEOUT.

In theory we could have an environment variable for every connection
parameter, but there's some cost to that. For example, if some program
wants to sanitize the environment of all PG-related environment
variables, it has more to do. It seems reasonable to me to have
environment variables only for the most important connection
parameters, rather than all of them. I would argue we've overdone it
already.

--
Robert Haas
EDB: http://www.enterprisedb.com