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 1iPs7B-0002VJ-KD for pgsql-general@arkaria.postgresql.org; Wed, 30 Oct 2019 17:50:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iPs79-0008Lm-90 for pgsql-general@arkaria.postgresql.org; Wed, 30 Oct 2019 17:50:35 +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 1iPs78-0008Lf-Sc for pgsql-general@lists.postgresql.org; Wed, 30 Oct 2019 17:50:35 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iPs76-0007aQ-BF for pgsql-general@postgresql.org; Wed, 30 Oct 2019 17:50:34 +0000 Received: by mail-wr1-x42f.google.com with SMTP id n1so3312242wra.10 for ; Wed, 30 Oct 2019 10:50:31 -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=G4nLqIUWVaIWq3FRx8uXNcbqEZx+Ixt3OPob7c2H8K0=; b=FgMcSaEnm34u9JfmJMZhN+T/wYgg7ni3TWrnPc1MxjeVQIht2JDPOVYQgRHEtrLUJn w54E/Pna1B5jnslqcT/NNg32iVkqpIyt5qrCrPlDrnUl5nen7GuulZ2nnhh7+eJGFaJ+ hldF7iiPss6W6ORocIcFkCmexFz64mMa2rPnYQt6bYLn7S0wPD4Oe5QiuBdHJPFb0d9Q fu7w194vYww4LMR2Nja/tES3PSxBJ+1JFufgYhfPrPRzPt6B7T8hm57XAUw9nVdlU2a1 DPd/ASA/yql/7pDROFSO2qiMNpGRG6PGJLuZbXRgsDf0PyMlkJUIpWuiZd1Ej3MCPFif glvA== 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=G4nLqIUWVaIWq3FRx8uXNcbqEZx+Ixt3OPob7c2H8K0=; b=fHh8anHpts9+9Cy5LOjoZUKmjQ9eW7jd+TLWboMdmaZiPfvsAXqREfYbztQFrsP7L1 Vw7r/J6Wn+moWYZjdx1rhwBlK6LYkMQu2my5KaJS9K+Q72d33J6u3PKo3ReFWOzvHr6+ uGGmQ5ieJbHsOuT+V4wSokNVujotDvrItnD9ZPLocTKTjzeM+wZSe14DF3Y1tIO1/xFj n+n7KEsDZFPxIDdc/fCNIr5a1pufimVVkWmvw8vGjyU8D7zLn6DKrlh2BcGrKxsVl+Xw hpj/H7/knhMPKCMwWmpcxYVfw40qv+PPjGY7Bdj/iLVXwIl54ZM+Z3bApFNimJkkWTVc uLjA== X-Gm-Message-State: APjAAAX+xFrOSGjKPjtlK+klzEq2keYHv3BDagJogno/eKmIzSIF/Heh H1uqUm+F4NsW6OxjefMMYe8+Eg== X-Google-Smtp-Source: APXvYqx7ZG8BjE4WDGzeg8eyng9/wSiv/4Dgsmvn4doElIwNo6IKviIt4vZ1LLm0b2quLLh47kXT+w== X-Received: by 2002:a5d:4ace:: with SMTP id y14mr1071366wrs.131.1572457829759; Wed, 30 Oct 2019 10:50:29 -0700 (PDT) Received: from android-fd1fa1e17354e78d (248.95.194.178.dynamic.wline.res.cust.swisscom.ch. [178.194.95.248]) by smtp.gmail.com with ESMTPSA id r2sm860657wma.1.2019.10.30.10.50.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2019 10:50:29 -0700 (PDT) Message-ID: <1aae112c37776a169fe2e73fdaba8be84b9f3ebf.camel@cybertec.at> 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: Wed, 30 Oct 2019 18:50:28 +0100 In-Reply-To: References: 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 On Wed, 2019-10-30 at 16:59 +0000, M Tarkeshwar Rao wrote: > Getting following error in using cursor to fetch the records from a large table in c language. > Can you please suggest why it is coming and what is the remedy for this. > > Error Details > ----------------- > Failed to execute the sql command close: > mycursor_4047439616_1571970686004430275FATAL: terminating connection due to conflict with recovery > DETAIL: User query might have needed to see row versions that must be removed. > HINT: In a moment you should be able to reconnect to the database and repeat your command. This is not a proble with your program. Your query is running against a standby server with "hot_standby" on, and there are conflicts between replication and your query. If you increase "max_standby_streaming_delay" in "postgresql.conf" on the standby, your query will be given more time to complete. This will, however, cause replay of the replicated changes to be delayed. Yours, Laurenz Albe