Re: psql connection option: statement_timeout

From: Craig Boyd <craig(at)mysoftforge(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: psql connection option: statement_timeout
Date: 2016-07-04 16:15:58
Message-ID: 577A8BBE.7010908@mysoftforge.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 07/04/2016 11:01 AM, Daniel Verite wrote:
> Craig Boyd wrote:
>
>> So to put it another way: is there a list that shows what options are
>> available during the connection event or as part of the connection string?
> Yes, but it belongs to the chapter on libpq. The psql docpage merely points
> to it:
>
> <quote>
> -d dbname
> --dbname=dbname
>
> Specifies the name of the database to connect to. This is
> equivalent to specifying dbname as the first non-option argument
> on the command line.
>
> If this parameter contains an = sign or starts with a valid URI
> prefix (postgresql:// or postgres://), it is treated as a
> conninfo string. See Section 31.1.1 for more information.
> </quote>
>
> In the HTML-formatted doc, this "Section 31.1.1" links to:
> https://www.postgresql.org/docs/9.3/static/libpq-connect.html#LIBPQ-CONNSTRING
> which has the list you want.
>
> Besides connection options such as "connect_timout", it happens
> that server config options, such as "statement_timeout", can also
> be incorporated into a connection string, through the
> "options" keyword and -c switch (possibly used multiple times)
>
> For example:
>
> $ psql -d "dbname=test connect_timeout=10 options='-c statement_timeout=1000
> -c geqo=off'"
>
> psql (9.3.13)
> Type "help" for help.
>
> test=> show statement_timeout ;
> statement_timeout
> -------------------
> 1s
> (1 row)
>
>
> Best regards,
Hi Daniel,

Thank you VERY much for helping to clear this up for me. This makes a
lot more sense now and is exactly what I was looking for.
I was able to test you sample statement and it was nearly spot on. I
just had to add the "hostaddr" and "user" options and it worked like a
champ.

Sincerely,

Craig Boyd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nicholson, Brad (Toronto, ON, CA) 2016-07-04 20:03:40 9.6 Beta 2 Performance Regression on Recursive CTE
Previous Message Daniel Verite 2016-07-04 16:01:20 Re: psql connection option: statement_timeout