pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
To: 'pgsql-general@postgresql.org' <pgsql-general@postgresql.org>
Subject: Re: Getting following error in using cursor to fetch the records from a large table in c language
Date: Thu, 31 Oct 2019 20:07:01 +0100
Message-ID: <ee2591e30acd5a74c39d3edd96efd6bc90273e52.camel@cybertec.at> (raw)
In-Reply-To: <VI1PR0701MB271832B90639DE955F1879FDAE630@VI1PR0701MB2718.eurprd07.prod.outlook.com>
References: <VI1PR0701MB2718C0817F667E16FDB74D9CAE600@VI1PR0701MB2718.eurprd07.prod.outlook.com>
	<1aae112c37776a169fe2e73fdaba8be84b9f3ebf.camel@cybertec.at>
	<VI1PR0701MB2718C6993AB35332B933B3EDAE630@VI1PR0701MB2718.eurprd07.prod.outlook.com>
	<5bf3f04959a82a8733da61093720f929bba00947.camel@cybertec.at>
	<VI1PR0701MB271832B90639DE955F1879FDAE630@VI1PR0701MB2718.eurprd07.prod.outlook.com>

M Tarkeshwar Rao wrote:
> When we running with vacuum full we are getting following error message.
> 
> Error:
> -------
> user was holding a relation lock for too long
> 
> Any idea about this error.

That means that you got a replication conflict, which is to be expected,
because VACUUM (FULL) is also one of the commands that require an
ACCESS EXCLUSIVE lock.

First suggestion: don't use VACUUM (FULL).

Second suggestion: A standby server can *either* be used for high
availability, in which case queries on the standby should be forbidden
or canceled in case of conflicts, *or* it can be used to run resource
intensive reading queries, in which case application of the transaction
log should be delayed.

Don't try to use a standby for both - use two standby servers.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






view thread (11+ messages)  latest in thread

Message-ID: <ee2591e30acd5a74c39d3edd96efd6bc90273e52.camel@cybertec.at>
Permalink:  ../ee2591e30acd5a74c39d3edd96efd6bc90273e52.camel@cybertec.at/
Also on:    postgresql.org/message-id/ee2591e30acd5a74c39d3edd96efd6bc90273e52.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, m.tarkeshwar.rao@ericsson.com
  Subject: Re: Getting following error in using cursor to fetch the records from a large table in c language
  In-Reply-To: <ee2591e30acd5a74c39d3edd96efd6bc90273e52.camel@cybertec.at>
  References: <VI1PR0701MB2718C0817F667E16FDB74D9CAE600@VI1PR0701MB2718.eurprd07.prod.outlook.com> <1aae112c37776a169fe2e73fdaba8be84b9f3ebf.camel@cybertec.at> <VI1PR0701MB2718C6993AB35332B933B3EDAE630@VI1PR0701MB2718.eurprd07.prod.outlook.com> <5bf3f04959a82a8733da61093720f929bba00947.camel@cybertec.at> <VI1PR0701MB271832B90639DE955F1879FDAE630@VI1PR0701MB2718.eurprd07.prod.outlook.com> <ee2591e30acd5a74c39d3edd96efd6bc90273e52.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