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 1tvZS3-005wkJ-LU for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Mar 2025 10:18:07 +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 1tvZS2-003aiW-5E for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Mar 2025 10:18:06 +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 1tvZS1-003aiG-IF for pgsql-hackers@lists.postgresql.org; Fri, 21 Mar 2025 10:18:05 +0000 Received: from fout-a4-smtp.messagingengine.com ([103.168.172.147]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tvZRz-000IMc-2o for pgsql-hackers@lists.postgresql.org; Fri, 21 Mar 2025 10:18:04 +0000 Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id 85E5C138339E; Fri, 21 Mar 2025 06:18:02 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Fri, 21 Mar 2025 06:18:02 -0400 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=fm1; t=1742552282; x=1742638682; bh=7 WsYa4mviYHuvM8KGS2//m/kXUPPF0CeuuRIuSwG4ms=; b=oeHCdHlRcmy6j57yQ cpNuoeCytHSHY33hy9UUApHOhQvEERm9/mia4Ktf/J7a1cH4A/y4Hg3DdBupCdxY al5CmpVGp8Yg2F33dUeBycgQzsuLr+HfqOKyo3B0XjOs5gTlUc0kkDH1SUoH3OI/ wW8Dd7mzHmCcn5dzsJPBA55G9j4UX3NJI8xaUS+Xk4vUgtapxvnTsHXM79qJOyGx LOTl04u0IUihwD6Knd9H/sVLJ3Zt527cDKZ25F7AGeyWv0h4uUTukTqhvAmbLXIT QkiOF4d67qmk+c77BIw91v9OxkB3afsdqmfOHK9oDQxYeMYYM66STmzODB4FyunN QWo+w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduhedtkeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepfffhvfevuffkgggtugfgjgesthekredttddt jeenucfhrhhomheplmhlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlh hvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnheptdduleefteffhffgjeek vdejgefhffellefgheeileetudektdegheffjeetueetnecuffhomhgrihhnpehptgdqfh hrvggrkhdrnhgvthdpvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhh drnhhoqdhiphdrohhrghdpnhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhht pdhrtghpthhtohepjhhirghnrdhunhhivhgvrhhsrghlihhthiesghhmrghilhdrtghomh dprhgtphhtthhopehthhgrnhhithefudduudesghhmrghilhdrtghomhdprhgtphhtthho peiguhhnvghnghiihhhouhesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqd hhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 21 Mar 2025 06:18:02 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1742552280; bh=q1YotT85dbnkAWfJieNpDlMq+M59fODtRfA0fpomUpc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=aNLM2ky2u+AZngL8/zdJopM2nK9XFl3jXa0VSOwlupZYaPcndIYo09nNKvkO5OvCv iTHYwQS8KFEJRJ9+gXsdyTdRpAtv8zIt0+IViL2WxWFckKVIqTWDfy4IJ9dyRKrxt8 ElZcQZ82pEO6QS7uFUwDatdtSfZpk75cGl3/AQLnL6NAIHIH3xIC5eXCbAeAxV8wuS C5UIoLX+cCL5OiwoalKB2wiScASeaQggxrucSynW4mimvJcecjD0zXT3xzGpfqNe1d 0AQl8b8geTdFhA1g/k469CxlsLHZ/xcD5gTqCLtqRNRJHqXGyfVn3U/J+Uusp3edeu nRyd74WApwDxg== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 1A9D08F; Fri, 21 Mar 2025 11:18:00 +0100 (CET) Date: Fri, 21 Mar 2025 11:18:00 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: jian he Cc: Xuneng Zhou , Navneet Kumar , pgsql-hackers@lists.postgresql.org Subject: Re: support virtual generated column not null constraint Message-ID: <202503211018.lsboinfrjn7w@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-Mar-20, jian he wrote: > ATRewriteTable: > for (i = 0; i < newTupDesc->natts; i++) > { > Form_pg_attribute attr = TupleDescAttr(newTupDesc, i); > if (attr->attnotnull && !attr->attisdropped) > { > if (attr->attgenerated != ATTRIBUTE_GENERATED_VIRTUAL) > notnull_attrs = lappend_int(notnull_attrs, i); > else > notnull_virtual_attrs = lappend_int(notnull_virtual_attrs, > attr->attnum); > } > } > this is kind of ugly? notnull_virtual_attrs is 1 based, notnull_attrs > is 0 based. > I want to change it all to 1 based. see v5-0002 Yeah, this inconsistency bothered me too. I have pushed your 0002 now, which means your 0001 needs a small rebase. I'm going to leave 0001 for Peter to commit, as it's mostly his turf. > + * We implement this by consing up a NullTest node for each virtual > trivial question. > I googled, and still found any explanation of the word "consing up". https://www.pc-freak.net/files/the-hacker-disctionary.html You could change "cons up" to "manufacture" in that comment and get about the same meaning. Maybe have a look at git grep -C3 -E 'cons(|ing|ed) up' I think the ChatGPT answer quoted by Zhou is roughly on point. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "El que vive para el futuro es un iluso, y el que vive para el pasado, un imbécil" (Luis Adler, "Los tripulantes de la noche")