pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Paul Turton <no-2@uber-force.co.uk>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Hard max_stack_depth / WIN32_STACK_RLIMIT PostgreSQL Windows Query
Date: Fri, 05 Jan 2024 10:26:01 -0500
Message-ID: <948271.1704468361@sss.pgh.pa.us> (raw)
In-Reply-To: <CWLP123MB7168AFA9E3EF973900D702F8F4662@CWLP123MB7168.GBRP123.PROD.OUTLOOK.COM>
References: <CWLP123MB7168AFA9E3EF973900D702F8F4662@CWLP123MB7168.GBRP123.PROD.OUTLOOK.COM>

Paul Turton <no-2@uber-force.co.uk> writes:
> Looking at the source code it appears that the maximum stack limit is hard 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 allow? Could I just increase the number and re-compile, or would that break other things?

A bit of "git blame" archaeology says that that traces back to

commit bf7737a938827608ce79586efe55c642c1a4a7d3
Author: Tom Lane <tgl@sss.pgh.pa.us>
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





view thread (2+ messages)

Message-ID: <948271.1704468361@sss.pgh.pa.us>
Permalink:  ../948271.1704468361@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/948271.1704468361@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, no-2@uber-force.co.uk
  Subject: Re: Hard max_stack_depth / WIN32_STACK_RLIMIT PostgreSQL Windows Query
  In-Reply-To: <948271.1704468361@sss.pgh.pa.us>
  References: <CWLP123MB7168AFA9E3EF973900D702F8F4662@CWLP123MB7168.GBRP123.PROD.OUTLOOK.COM> <948271.1704468361@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox