Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lW1uh-0002kI-LU for pgsql-general@arkaria.postgresql.org; Mon, 12 Apr 2021 19:07:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lW1ug-0001OK-JI for pgsql-general@arkaria.postgresql.org; Mon, 12 Apr 2021 19:07:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lW1ug-0001OD-8n for pgsql-general@lists.postgresql.org; Mon, 12 Apr 2021 19:07:58 +0000 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lW1ue-0003VG-8k for pgsql-general@lists.postgresql.org; Mon, 12 Apr 2021 19:07:57 +0000 Received: by mail-oi1-x22a.google.com with SMTP id j24so3645131oii.11 for ; Mon, 12 Apr 2021 12:07:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=JI+p6km3yZYhee9v9sspMP0C/LUbzyT0QR1Zoz8/w5U=; b=pJyHx8YQvw1sqFWe/pnL17eNTEf/446YL3Shk1PPA/JofQILOc0o8EJ0jjHcxLocuc UVOsVC8BXE49FMFZUxqxY0nokh7sSfsc2W3bPlEM6D+tIVkQPzIT2x2q481QORlvwPEs tV5CCiNwefyomc6IJCJimSae52oMYx9QUmyMf7JxBmASbNlvGH93aMq567eVasVGXJ6T JjponUckiP+nB4QAOr8hZGfRN9qAxr0cobJUlgonZSIMdIeD1O8ylo2IUYM0nuQB18Xi rzqjynaU3LbXzolABGz+ws6Dad81XKW3bmETtOlfaPkeUEMe3EONXbgXVRrWaBsZi9nk b9tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=JI+p6km3yZYhee9v9sspMP0C/LUbzyT0QR1Zoz8/w5U=; b=lpHQp78/DlwTavkGlGucImxdSzNSIrd8YxKMP1nFNpSyut9SibMXejyn8+sngoo6mv P59vZq/ivo7EZB2+xfdOgPa8qWd4NK8y/ACbp4uBR94r3bVOlJD8o/mAK94K/QxH5h7b ZtlpU/vFcSDPK2NbTFzZvU2PqIohYItdR5tWvl7/mhH4UWGyMciMCuT3lmPA1Do03Vld c+UsuIWCfiO9E8DDwEPp1OtXq+/FOpF90C0AqpeEtqkCAvVnOf9EpwdRIGF7y4r19iOv v9lZk4WCgv3A9rYlVNf+0QTSFy/fckGixuBajRNzn4q/W7PRzpCfVGKRcS/zOaekTn9j jePQ== X-Gm-Message-State: AOAM532aWMl9Rwa3wt0IlmlGYCJbSHuO/rFpmf4Vf8nHFQ27Hd2IpYVT jK0b8PHEp0rYX/5i46sVbbGRkRVMd4s= X-Google-Smtp-Source: ABdhPJylH0IdrpqfOmhEzi4eO2K2iOYfzj4qAGjqj/YRHlOK3539CY2zx96BEwAMJij6no2l9IOIzw== X-Received: by 2002:aca:7c4:: with SMTP id 187mr469647oih.47.1618254473591; Mon, 12 Apr 2021 12:07:53 -0700 (PDT) Received: from [192.168.88.10] (ip174-67-141-204.no.no.cox.net. [174.67.141.204]) by smtp.googlemail.com with ESMTPSA id a7sm2330103ooo.30.2021.04.12.12.07.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Apr 2021 12:07:53 -0700 (PDT) Subject: Re: Reuse of REF Cursor To: pgsql-general@lists.postgresql.org References: <2671626.1618154631@sss.pgh.pa.us> <2691494.1618163401@sss.pgh.pa.us> From: Ron Message-ID: Date: Mon, 12 Apr 2021 14:07:51 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 4/11/21 1:02 PM, Abraham, Danny wrote: > 2021-04-09 08:00:08.692 IDTERROR: canceling statement due to statement timeout > 2021-04-09 08:00:08.692 IDTCONTEXT: PL/pgSQL function orhpans_active_clean_table(character varying,integer) line 42 at FETCH > PL/pgSQL function orhpans_active_removal() line 31 at assignment > PL/pgSQL function ajf_backup(integer) line 39 at assignment > > Can a FETCH fail if the table is locked? The FETCH is stuck for the time. > > Should I lock all tables involved with the query? > > Any specific time-out on the fetch? Or should I use the general statement-timeout? > > I mean move from regular programming mode to paranoidic mode.... > > The failure is inconsistent.. Never fails in PG 11.5, but fails in PG9.5.5 about once a week... > > I need a full understanding of the problem in order to force big,slow customers to migrate to PG11.5. 9.5.21 would be an important step.  Heck, it might solve the problem. -- Angular momentum makes the world go 'round.