Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iQFpw-0004D0-RW for pgsql-general@arkaria.postgresql.org; Thu, 31 Oct 2019 19:10:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iQFpu-00018d-Lc for pgsql-general@arkaria.postgresql.org; Thu, 31 Oct 2019 19:10:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iQFmk-0005fr-Sf for pgsql-general@lists.postgresql.org; Thu, 31 Oct 2019 19:07:06 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iQFmh-0005iL-WB for pgsql-general@postgresql.org; Thu, 31 Oct 2019 19:07:06 +0000 Received: by mail-wr1-x443.google.com with SMTP id w18so7492176wrt.3 for ; Thu, 31 Oct 2019 12:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=1yk6ul7g56exxaP7B8hSZva2+32KCnBF/uClspsCLlY=; b=DFNz03jrpv6yxuLUU9SFoCyl8olWHNMKRsXBW1KyukQMKrj5PLRFKFFzw10B9AeQlL HP58yYSHDB5CkgP8DTkah+dEBW/Piqi4AuA4KhgUIREx2zyLo8QhU+aqRjEflZ+rYD89 qiwwIOOR6bZnDAiQ678HI9yF71AVCyaphBRfJXMPWn5tncM4c/oXWcXCQAFpx7fP/GVJ PXNUaf8bE5pWnzvldGlMVp5YfP4H4dZ7m0KL5p0gq5VFLmIpYgs0eyvX3zrHFCpfYnfu pVjOZkzuEW4soHRyJ8MMrOLCEf6ZHjnSsN4iQ+ZxEgY2SXeuypp/VtFZuhCheUAOkcCD dKqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=1yk6ul7g56exxaP7B8hSZva2+32KCnBF/uClspsCLlY=; b=PhmhGB5xifoT0xSWAnNGUwA7cCGKY+pRI8F44g4Ndd0mm8i7aKkKlSiQoQCd1uzRib cWqec2J+1zwY1kT7u1Ha1b4T4asgjcxSmQEy5VpWz7738vX92O2+FchZXPMeyICAtaHB 9SGtpKjy+ca1n9NnKQgT27ZRP7O3tProN24BUkrj55fbWGGlcM+Bu4Mrq27RH0dv6B64 UJPsQEZsnn3xHvYm4B9CevvyNSOXwIeyQ+84InF2pxOiKWtzOjZHphOFWmgMu3WEOHxU GkQSXdEVlD/6WaLCBmK7H7Cr8SYCKBxUwA2WkrMe/C+6qx50KKdVuXR1bn3LIS0dP8dk IHjw== X-Gm-Message-State: APjAAAWHMGWekBR8Iwz/KcZbZgDW4eANMa9DzbpvijJM3mXbxx0L8KBZ pU4IsiKCeLjCHPjB7oIpvg7/EA== X-Google-Smtp-Source: APXvYqy1KAfxpu17EWHkwJYtfPi/qk0ni554siUOfxkcgZ17ovzlf+FOnEW+0CJe+wbRyx+rsd/+Yw== X-Received: by 2002:adf:f80c:: with SMTP id s12mr6873981wrp.37.1572548823129; Thu, 31 Oct 2019 12:07:03 -0700 (PDT) Received: from localhost.localdomain ([213.208.157.36]) by smtp.gmail.com with ESMTPSA id m9sm4728140wro.66.2019.10.31.12.07.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2019 12:07:02 -0700 (PDT) Message-ID: Subject: Re: Getting following error in using cursor to fetch the records from a large table in c language From: Laurenz Albe To: M Tarkeshwar Rao , "'pgsql-general@postgresql.org'" Date: Thu, 31 Oct 2019 20:07:01 +0100 In-Reply-To: References: <1aae112c37776a169fe2e73fdaba8be84b9f3ebf.camel@cybertec.at> <5bf3f04959a82a8733da61093720f929bba00947.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.4 (3.32.4-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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