pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Troels Arvin <troels@arvin.dk>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: max_standby_streaming_delay or hot_standby_feedback
Date: Thu, 29 Oct 2026 13:25:09 +0100
Message-ID: <0e1edf6b16a2ed04672e1802de416b300cf9dea3.camel@cybertec.at> (raw)
In-Reply-To: <140108b8-2861-4d98-ba14-a7a6d8f3be78@arvin.dk>
References: <140108b8-2861-4d98-ba14-a7a6d8f3be78@arvin.dk>

On Thu, 2026-10-29 at 10:45 +0100, Troels Arvin wrote:
> I have a setup with a rather busy and semi-large primary Postgres server 
> which uses physical streaming replication to a secondary server. The 
> secondary server is to be used for read-only queries (reporting), and 
> I've starting running pg_dumps towards the secondary.
> 
> I now run into error messages like the following when pg_dump works 
> against the secondary:
> 
> pg_dump: error: Dumping the contents of table "sometable" failed: 
> PQgetResult() failed.
> pg_dump: detail: Error message from server: ERROR: canceling statement 
> due to conflict with recovery
> DETAIL: User query might have needed to see row versions that must be 
> removed.
> pg_dump: detail: Command was: COPY someschema.sometable (col1, col2, 
> col3) TO stdout;
> 
> I have tried setting
> max_standby_streaming_delay = 5min
> (Default is 30s.) That doesn't help.
> 
> I'm wondering: Should I further raise max_standby_streaming_delay, for 
> example to 30min?
> 
> Or should I set hot_standby_feedback to "on"? 

If these are reporting queries, delaying replay is fine.
So set "max_standby_streaming_delay" to -1, that will avoid query cancellation.
Don't enable "hot_standby_feedback", otherwise reporting queries on the standby
can bloat tables on your primary.

Yours,
Laurenz Albe






view thread (4+ messages)  latest in thread

Message-ID: <0e1edf6b16a2ed04672e1802de416b300cf9dea3.camel@cybertec.at>
Permalink:  ../0e1edf6b16a2ed04672e1802de416b300cf9dea3.camel@cybertec.at/
Also on:    postgresql.org/message-id/0e1edf6b16a2ed04672e1802de416b300cf9dea3.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, troels@arvin.dk
  Subject: Re: max_standby_streaming_delay or hot_standby_feedback
  In-Reply-To: <0e1edf6b16a2ed04672e1802de416b300cf9dea3.camel@cybertec.at>
  References: <140108b8-2861-4d98-ba14-a7a6d8f3be78@arvin.dk> <0e1edf6b16a2ed04672e1802de416b300cf9dea3.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox