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.96) (envelope-from ) id 1vIYbg-005LSX-08 for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Nov 2025 20:35:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vIYbc-002NQM-2F for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Nov 2025 20:35:16 +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.96) (envelope-from ) id 1vIYbc-002NQE-1F for pgsql-hackers@lists.postgresql.org; Mon, 10 Nov 2025 20:35:16 +0000 Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vIYba-0072av-08 for pgsql-hackers@postgresql.org; Mon, 10 Nov 2025 20:35:16 +0000 Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-93e9b5bafa5so119907139f.3 for ; Mon, 10 Nov 2025 12:35:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762806911; x=1763411711; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=8bfkn/Blrmqp6gIDiHvCZZGbn12FfRxmQxxtRAw/KHs=; b=hmZTAESu3vrhXX7toO47hpCnFrNWUfmq+XMh0dq1aLHU6mUv6vWbAKh/hqT/jbgoKh Bp2xwO+YAzOwAwfL5mccIkVGUC8da0y2Cs4oNUC76v1Do6vghG3EfmlQtICnyBQl8DVu NvIzJOM2A6cxkSYzz5RvPt0ucUVkVccBaEisi7XZNoYj/L2uRSuupuCESD+f7Mksl/5F ImfrneSLYTEmMh6BwjYOHqUbryLIrlTif1JtacVzFiLP2JAxbBJsQv6u/ivrcV6nWd1s tid3YNDKJ/mwOz4m0oxrER+yQuFP4eU0DWK7IfGezkyPY6z3S7VOp+DCYoybdr1CKJcd 8+Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762806911; x=1763411711; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8bfkn/Blrmqp6gIDiHvCZZGbn12FfRxmQxxtRAw/KHs=; b=XNa1WWJ1yiJB8IS/2i5TSTnejXufiBoNDag3Ys7OhTAdHDCXcobWC8xmtuu78jCBj/ 9Qg4HmUWyMfHD02yWMCxX2tQQAsxM5lP53CjzFDbhDS4CN688mdl2XGlUXrJcEhVDu0q HivDbgpxwJuPbiVhnZ4eydsmuEO98Cwbk5utSn99xuPEMCRpzfqF1LUIhDCwUirVpFhI fitMFU7B+mcr1Mspi+iNSxVoqFIZzCsEjQYg5Gdv3yfez56jUk44JU29zsAWNRTDvx+C fntsDjvA6eGxq7pg1wK1h0HhOgB9sXl5ZU8on1l6do5a8GBFdIk79OTSRfvtbONuvQpF uJ9g== X-Forwarded-Encrypted: i=1; AJvYcCWifKll9KJ/kQP6sen6Hgd8+xf/U5EvjWLS2WHnZkCSK5K+07pDgFCQNlTk0VQNOPj/bmZW2q+nk73er6io@postgresql.org X-Gm-Message-State: AOJu0Yx5cBUIuDnnokI0XMWRsNJHygCxdHnaw+MZgwP3AVo8I8vAnt9F 165odcQxYtAmqVq9H4I26r1dpTsUolCC+raHGt2XUt/iwdPTn0iwR3W+ X-Gm-Gg: ASbGncvtta9DF8+tr5qQSUnPl+4hxo/5YexLrsEo4hdxLv7HUPIv0FW5WYQOkjv+HyW i8YjxJlTES2CzlMKU2P2hfJoAnyePswsA1Vt3Sgya4POacFxrIucrUYEgK+HPOnO1rQXQGDRS7o CbzaDFXUPjxna4vx6lsRc5cWt1j7+hIcVwIeMUUDuufTTHjBmdwSmE++f5W3enb08i7g9hcFEfa c1OFToB4c6I1mA3HXH33DRrVjq9twaWuhd2wJReowTwWHrCLq40pQT1ZWY8resJ+N/Pcn56m5Jk wjDGGHNLNJIT2QCAnMXH2G2+GFtOg9LHkKtlqnfMGxhQ5meX6f/i3+Y6gIlSZnLeO8IwtNXTrf5 I3tkgT7yJ7ywNFSXaZh/8rfCXLBK6UfZcA26UqVJhybQXhBzuKSkBlzkmuu1VmeLwmK1wuoTVXC U1H5pCJlxSseqbBD+B/sat864pdROTOSznU0nDVftlW0jxzMYJF7w0zMOSlnvTti8ObmzDvsnbv Ebh X-Google-Smtp-Source: AGHT+IFpd7KWE1TCMC4G8Jq6Gq7GDdMGlUG9TIz0OnS7ThIz9ekU7z4e9vb1DrlF/L5i1aBICB3T6w== X-Received: by 2002:a05:6e02:2681:b0:433:4fc9:7b38 with SMTP id e9e14a558f8ab-43367e65149mr124125795ab.28.1762806911310; Mon, 10 Nov 2025 12:35:11 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-5b746647767sm5397845173.0.2025.11.10.12.35.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Nov 2025 12:35:10 -0800 (PST) Date: Mon, 10 Nov 2025 14:35:09 -0600 From: Nathan Bossart To: Tom Lane Cc: Maxim Zibitsker , pgsql-hackers@postgresql.org Subject: Re: Support allocating memory for large strings Message-ID: References: <5B146D62-35AE-4822-9B98-37E386AFB942@gmail.com> <1357347.1762569165@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1357347.1762569165@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Nov 07, 2025 at 09:32:45PM -0500, Tom Lane wrote: > Maxim Zibitsker writes: >> PostgreSQL's MaxAllocSize limit prevents storing individual >> variable-length character strings exceeding ~1GB, causing "invalid >> memory alloc request size" errors during INSERT operations on tables >> with large text columns. > > This is news to no one. We are not especially interested in trying to > relax that limit, because doing so would bleed over into approximately > everything in the backend, and create opportunities for > integer-overflow bugs in many places that are perfectly okay today. > The cost-benefit ratio for changing this decision is horrible. FWIW something I am hearing about more often these days, and what I believe Maxim's patch is actually after, is the 1GB limit on row size. Even if each field doesn't exceed 1GB (which is what artifacts.md seems to demonstrate), heap_form_tuple() and friends can fail to construct the whole tuple. This doesn't seem to be covered in the existing documentation about limits [0]. [0] https://www.postgresql.org/docs/devel/limits.html -- nathan