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 1tAoN9-000FQg-Eq for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Nov 2024 10:43:46 +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 1tAoN6-005JJY-Rm for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Nov 2024 10:43:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tAoN6-005JJP-16 for pgsql-hackers@lists.postgresql.org; Tue, 12 Nov 2024 10:43:45 +0000 Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tAoN4-001T07-0q for pgsql-hackers@lists.postgresql.org; Tue, 12 Nov 2024 10:43:43 +0000 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.stl.internal (Postfix) with ESMTP id 04C0625400D0; Tue, 12 Nov 2024 05:43:40 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Tue, 12 Nov 2024 05:43:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1731408220; x=1731494620; bh=Z m3yWdCuE5oiSQeR5zY8aChoxCrNI/1cIKTKoai7PnI=; b=eQL+XHGC+fwp90oaO mGzRaekrM81gxnvjHxD09t3b+V6564w14Z9+EVk4C1VSqQVoDfsb4eZGT6dt7+HX 44AfxywIHa6p8tWnwPpM6WNkKO/V177AqTP2Y24e5k2MYjNj8+Zag1zx6GpKjG+q 6TLpyEo/E5hS/TorHyO2+9KojuX9xdhl8XoG72mdyuP3jlZPoQm7WUI3BIKr6XK9 BVLq3or7PZcHhOp4SeJPfl2zVeQ2BZ69DLmwbOAguBHwZXwvZsBLTn9aFB/ACS5R IPu8Oawa3cbxN3tvKwwGGzGUl2JBSUoJ8S2Wyd/LYYx8N13Q3jABKhyzgUZGCCWk MW+Tw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeggdduiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecu hfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrd hnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfej jefhgfeiueeukeejkeffgfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprh hishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdpnhgspghrtg hpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepjhhirghnrdhunhhi vhgvrhhsrghlihhthiesghhmrghilhdrtghomhdprhgtphhtthhopehtnhgurhifrghngh esghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhs thhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehtghhlsehsshhsrdhpgh hhrdhprgdruhhs X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Nov 2024 05:43:40 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1731408218; bh=7kp2QgJlrCA52WXroObUHN0Q9zXioqdH8QpjCwxMr6w=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=gwr2FfM7dc3kcpUXFUHRVM4ErvcvShM71dffiHzLFygFW+aVW8mslBhDCIfBx37lT QmmBd1rIfatyY7hlDKnpFhE48otZL4WGiJvPK+KnlahQC7U2JI74gcDxjD9dz07aNW hNBIKK/WrC41hvhoW2fYYVOKT8B8ksBnNQSV5aKMzkwPRpCcKtqp1atc/fB8kzFyjr GW1+9djHjgsUQWghYlWee4jyUqM2oElJIv9m1m3jsq6za1I8SX2wxC1cEyqyuk4rfH OoRdRmhf3GMQv10gqz0iW/dVt8LJoMwTw6A0nfw3k67A1gPJ1qouIX0Q8WodMutUbJ lUi4mRUr8C3qQ== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 124C595; Tue, 12 Nov 2024 11:43:38 +0100 (CET) Date: Tue, 12 Nov 2024 11:43:38 +0100 From: Alvaro Herrera To: Tom Lane Cc: jian he , Pg Hackers , Tender Wang Subject: Re: not null constraints, again Message-ID: <202411121043.kselx23nuhri@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202411091229.k6wy32lley63@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-Nov-09, Alvaro Herrera wrote: > I notice I cargo-culted a "free de-toasted copy", but I think it's > impossible to end up with a toasted datum here, because the column is > guaranteed to have only one element, so not a candidate for toasting. > But also, if we don't free it (in case somebody does an UPDATE to the > catalog with a large array), nothing happens, because memory is going to > be released soon anyway, by the error that results by conkey not being > one element long. I found out that my claim that it's impossible to have a detoasted datum was false: because the value is so small, we end up with a short varlena, which does use a separate palloc(). I decided to remove the pfree() anyway, because that makes it easier to return the value we want without having to first assign it away from the chunk we'd pfree. The DDL code mostly doesn't worry too much about memory leaks anyway, and this one is very small. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ “Cuando no hay humildad las personas se degradan” (A. Christie)