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 1nnmO9-0004oF-Fh for pgsql-sql@arkaria.postgresql.org; Sun, 08 May 2022 19:16:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nnmO7-0001zq-6z for pgsql-sql@arkaria.postgresql.org; Sun, 08 May 2022 19:16:15 +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 1nnmO6-0001zg-Un for pgsql-sql@lists.postgresql.org; Sun, 08 May 2022 19:16:14 +0000 Received: from mail-oo1-xc2e.google.com ([2607:f8b0:4864:20::c2e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nnmNz-0003Tr-4m for pgsql-sql@lists.postgresql.org; Sun, 08 May 2022 19:16:13 +0000 Received: by mail-oo1-xc2e.google.com with SMTP id v33-20020a4a9764000000b0035f814bb06eso49840ooi.11 for ; Sun, 08 May 2022 12:16:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nS8cNzCrMizKPfO69LuxWXCchpcdX8otXI92dg17EuE=; b=moBo0xuLmxDdjc7Uq+FQlVerWGNBsXH4wN2RTinJpWgoVjkOoKCMzrmwGV7pXPW4Q1 ucn0k7WLjMlkUoHlj1DaKvREdsmNe7QCjaIbUVfd8h3P4MSkLY7DGcE1L40UzM2l+uwO OxmBBc8YPopi8DrfScNhEcMpt6qZCd4fnhAZLkkL1ZzEtj6qAh8xMGmnkd13CBBxNdeL P9tFkWxKweX72MVfPHHFerRXYb6A9gZP+Oz6VHVPHlX/5u8j/s1fT/8HfiY0SuoFRR6E 1NdQzeoc+faWhK6nR/8MLFJjuVJN56NPvKm3KV4mqWDtRifDVvUyHESMHF0eF5dcvRmt JtFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nS8cNzCrMizKPfO69LuxWXCchpcdX8otXI92dg17EuE=; b=zvk+DFsVTWHeTpFGtCrsM5Y8bpRItAqwPPrIVONes2Er5FxDe9dovmh/C2vH/04C+k hwo/+gocd1A2XBIm1m8tz/H9DEDHRZ08TtcTwX53gK2SI0lkFOYHxZd0twvLFP/kuGRz IwGhBPPfWwIqE6NhJ9lX2GL5zIduTM+DnBO8NJt3LV6FKQ8G/gWkjCPesrJTR1NlTLtX eVsxNWtlADkGDlTc3mRXVi1sPw3hrHMf7I8E0SiMfFzWBN88BObNyYQvqbVkPK3xRdW+ 2uGfAi+pkZ6iiA3SsoGU2V2IXuKxnQ/VVCwVpM4eN3FXZ/Brma8wzoO55S/hdLhAxaYI 96UQ== X-Gm-Message-State: AOAM5316VPcubTiNCD5xm6ar1yUCNbazQnfaQ4yiMRH9Oz6aV1sXXKbw 750ka729ljmGy5cOh5oQ14RtTSwV3lSFdVZHe/dEmOO5x+D9Iv1mwUBvQyrfL+2s8GwgTrazyi8 zv84iaXbwwfpBv4eyyjxnmg9Ud9olu5+l0UuDYi+Offtvwy4lPaOchAjf1zLvyXUv6xcnbkjKkO lBEFMk948mj34yFDhQY1Nfq5CmkXfshb05L2+49xDE9dJgn/YqyvYHGrTN5Pc1+QE= X-Google-Smtp-Source: ABdhPJwfc6dKUDfnfc2DuoTLVS+u9U51LBI+1Zxj9tWNEg4Xi8gbIE3Zvvh11GhuinRUFUOA66U3zyiWLF5lVaM/ROU= X-Received: by 2002:a4a:9762:0:b0:35e:ea5f:ebf0 with SMTP id v31-20020a4a9762000000b0035eea5febf0mr4668226ooi.89.1652037365003; Sun, 08 May 2022 12:16:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Simon Riggs Date: Sun, 8 May 2022 20:15:54 +0100 Message-ID: Subject: Re: Recursive query - ERROR: invalid memory alloc request size 1073741824 To: Shaozhong SHI Cc: pgsql-sql Content-Type: text/plain; charset="UTF-8" X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, 7 May 2022 at 14:24, Shaozhong SHI wrote: > > There is a loop of recursive query. It runs at a point where it stops. > > This error turned up.- ERROR: invalid memory alloc request size 1073741824 > > Can anyone provide pointers how to solve this problem or work around? For both recursive and non-recursive queries its possible to write a query with mistakes in it that will run for a long time or run out of resources. Find the mistakes in your query by simplifying it. -- Simon Riggs http://www.EnterpriseDB.com/