Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rLm5G-000KKH-5n for pgsql-general@arkaria.postgresql.org; Fri, 05 Jan 2024 15:26:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rLm5F-001E2C-1t for pgsql-general@arkaria.postgresql.org; Fri, 05 Jan 2024 15:26:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rLm5E-001E23-Nl for pgsql-general@lists.postgresql.org; Fri, 05 Jan 2024 15:26:04 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rLm5D-0000gx-6H for pgsql-general@lists.postgresql.org; Fri, 05 Jan 2024 15:26:04 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 405FQ1BK948272; Fri, 5 Jan 2024 10:26:01 -0500 From: Tom Lane To: Paul Turton cc: "pgsql-general@lists.postgresql.org" Subject: Re: Hard max_stack_depth / WIN32_STACK_RLIMIT PostgreSQL Windows Query In-reply-to: References: Comments: In-reply-to Paul Turton message dated "Fri, 05 Jan 2024 12:07:14 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <948270.1704468361.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 05 Jan 2024 10:26:01 -0500 Message-ID: <948271.1704468361@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Paul Turton writes: > Looking at the source code it appears that the maximum stack limit is ha= rd coded as 4194304 bytes for Windows builds. My query is why this number = was picked? Is it to do with the maximum size the Windows Kernel will allo= w? Could I just increase the number and re-compile, or would that break ot= her things? A bit of "git blame" archaeology says that that traces back to commit bf7737a938827608ce79586efe55c642c1a4a7d3 Author: Tom Lane Date: Wed Jan 26 21:55:26 2005 +0000 On Windows, set the postmaster executable's stack size to 4MB, so that it agrees with the default value of max_stack_depth. So yeah, you could probably increase it in a custom build. However, I question a bit why you think you need to. IME hardly anyone ever fools with max_stack_depth, on any platform. regards, tom lane