Thread: Statement_timeout effect on replication user

Statement_timeout effect on replication user

From
Teja Jakkidi
Date:
Hello Postgres Admins,

I am trying to set statement_timeout parameter to 1 hour at instance level due to some production issues that we have
noticedwith long running queries. 
We also have hot stand by replication setup using a user with replication privilege. Now, if I setup statement_timeout
atinstance level, will this affect the replication session as well? 

Thanks,
J. Teja.


Re: Statement_timeout effect on replication user

From
"David G. Johnston"
Date:
On Wednesday, August 7, 2024, Teja Jakkidi <teja.jakkidi05@gmail.com> wrote:

I am trying to set statement_timeout parameter to 1 hour at instance level due to some production issues that we have noticed with long running queries.
We also have hot stand by replication setup using a user with replication privilege. Now, if I setup statement_timeout at instance level, will this affect the replication session as well?

Set it to 10 seconds and see if anything breaks?

I would doubt it since replication doesn’t involve SQL statements.

David J.

Re: Statement_timeout effect on replication user

From
Muhammad Imtiaz
Date:
Hi,

Setting statement_timeout to 1 hour means that any query running longer than 1 hour will be automatically stopped. This applies to queries from applications or users, including those with replication privileges. However, this timeout does not affect the replication process itself. The continuous transfer of WAL files from the primary server to replicas will continue as usual, unaffected by the statement_timeout setting.

Regards,
Muhammad Imtiaz

On Thu, Aug 8, 2024 at 1:56 AM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Wednesday, August 7, 2024, Teja Jakkidi <teja.jakkidi05@gmail.com> wrote:

I am trying to set statement_timeout parameter to 1 hour at instance level due to some production issues that we have noticed with long running queries.
We also have hot stand by replication setup using a user with replication privilege. Now, if I setup statement_timeout at instance level, will this affect the replication session as well?

Set it to 10 seconds and see if anything breaks?

I would doubt it since replication doesn’t involve SQL statements.

David J.