set statement_timeout does not work

Started by Jun Wangabout 16 years ago3 messagesgeneral
Jump to latest
#1Jun Wang
junw2000@gmail.com

Hi,

I try to set the statement_timeout so that "select pg_stop_backup();"
will not hang if archive command failed. Below are the command and
errors.

psql.exe" -d mydb -h myhost -p 5432 -U postgres -w -c "set
statement_timeout = 1000; select pg_stop_backup();"
WARNING: pg_stop_backup still waiting for archive to complete (60
seconds elapsed)
WARNING: pg_stop_backup still waiting for archive to complete (120
seconds elapsed)
WARNING: pg_stop_backup still waiting for archive to complete (240
seconds elapsed)
WARNING: pg_stop_backup still waiting for archive to complete (480
seconds elapsed)

I also tried to run the two commands seperately as below. It also does not work.

psql.exe" -d mydb -h myhost -p 5432 -U postgres -w -c "set
statement_timeout = 1000;"
psql.exe" -d mydb -h myhost -p 5432 -U postgres -w -c "select pg_stop_backup();"

If I change the "statement_timeout" setting of postgresql.conf, it
works. But it will afftect all the queries.

How to use psql to do it?

Thanks.

Jack

#2Jun Wang
junw2000@gmail.com
In reply to: Jun Wang (#1)
Re: set statement_timeout does not work

Hi,

I try to set the statement_timeout so that "select pg_stop_backup();"
will not hang if archive command failed. Below are the command and

Can somebody help on this?

Thanks.

--------------------------------------------------------------------------------------------------------
* From: Jun Wang <junw2000@gmail.com>
* To: pgsql-general@postgresql.org
* Subject: set statement_timeout does not work
* Date: Mon, 29 Mar 2010 19:33:55 -0700
* Message-id: <deff9e831003291933k63585027h5afcc1451f91dd4e@mail.gmail.com>

Hi,

I try to set the statement_timeout so that "select pg_stop_backup();"
will not hang if archive command failed. Below are the command and
errors.

psql.exe" -d mydb -h myhost -p 5432 -U postgres -w -c "set
statement_timeout = 1000; select pg_stop_backup();"
WARNING: pg_stop_backup still waiting for archive to complete (60
seconds elapsed)
WARNING: pg_stop_backup still waiting for archive to complete (120
seconds elapsed)
WARNING: pg_stop_backup still waiting for archive to complete (240
seconds elapsed)
WARNING: pg_stop_backup still waiting for archive to complete (480
seconds elapsed)

I also tried to run the two commands seperately as below. It also does not work.

psql.exe" -d mydb -h myhost -p 5432 -U postgres -w -c "set
statement_timeout = 1000;"
psql.exe" -d mydb -h myhost -p 5432 -U postgres -w -c "select pg_stop_backup();"

If I change the "statement_timeout" setting of postgresql.conf, it
works. But it will afftect all the queries.

How to use psql to do it?

Thanks.

Jack

#3Scott Marlowe
scott.marlowe@gmail.com
In reply to: Jun Wang (#1)
Re: set statement_timeout does not work

On Mon, Mar 29, 2010 at 8:33 PM, Jun Wang <junw2000@gmail.com> wrote:

Hi,

I try to set the statement_timeout so that "select pg_stop_backup();"
will not hang if archive command failed. Below are the command and
errors.

Try it by putting the commands in a file and running it like

psql ..... -f mysqlfile.sql