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.98.2) (envelope-from ) id 1xRASF-00000000k6i-3lCv for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Nov 2026 15:41:44 +0000 Received: from localhost ([127.0.0.1]:49964 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xRASE-0000000BpMT-1nFz for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Nov 2026 15:41:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]:35308) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xRASE-0000000BpMI-09yX for pgsql-hackers@lists.postgresql.org; Wed, 11 Nov 2026 15:41:42 +0000 Received: from fout-b7-smtp.messagingengine.com ([202.12.124.150]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xRASC-00000000OZu-2LAD for pgsql-hackers@lists.postgresql.org; Wed, 11 Nov 2026 15:41:41 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id A52171D0023E for ; Wed, 11 Nov 2026 10:41:38 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Wed, 11 Nov 2026 10:41:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm1; t=1794411698; x= 1794498098; bh=93Qq4+WtBHRVg9xi0zkI51lucVGlwsTRQ8gzTFjZdko=; b=X iWCjTlB/YqmHVfOq0V2TCBnIBG72CPF0Jk2OVk/BmsUBKLV+VtxZXJidEPWtWDPF zWaVYa1NOaqie8sAbIrn5zirc+2V67AefGEJ5umE2KDxIsCpyK9uZkdCYnR1PW4w s9LO98vRodxDy2TDmaNuwOrEIDWw2BXUg/F18xmU9nYcs/NvyN2qyiDn4pD5OlN3 ltqWmoYUyKuY5vhP03ulNbmYLSzQqo3GlMNyEEIYhexfkQofRzz+XzDB/zT9DW/d yXv1nbws+u0LlKZe0eeWzllvk/FV2s6ljTJ/FVWwOuCcJLZVMUhCGsYI+oDirxaf 5Eo7wDEh9GhCisFjEy7/w== 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=1794411698; x=1794498098; bh=9 3Qq4+WtBHRVg9xi0zkI51lucVGlwsTRQ8gzTFjZdko=; b=JYUKQsKpkpVh4oMSO Cmz9bx+7fVxGADgL/x8JXfubMVTkInB76hYqwN/Dp0yiJX8BpTy6tccn1rVUYUug Z5cybTuz5iEqsrSEDuukugwnJeTUAJUGMvMqe2rox3K5MSGQxYb1a4/Tr/Nl2i2H XB7sOdX0Ww0jTj9tgJXVAVjUxXwXOWMAEDNM9uCUlha4OkV3peuan4Twza7YuZDJ u/rzJoE0anGsfVhHKM92CMJIhh87RPwOObD4UxnvfQBrzGD1lEVWow6xQ6pKFSMI bilRmxza2uuJt52kbPVOHHweWIDuCaL3noJKScYF23mz2mwyRnlNFKCFmUaZ4RpB x3h/g== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=kurilemu.de a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1794411698; d=kurilemu.de; mf=PGFsdmhlcnJlQGt1cmlsZW11LmRlPg==; rt=PHBnc3FsLWhhY2tlcnNAbGlzdHMucG9zdGdyZXNxbC5vcmc+; s=fm1:rsa-sha256:DBplY667p+URigVKwALsDu134Glcvc1yvHp11CU/Fq7hL/G sZwXHnPH3dgf8e4zvACOxgXJ9f6SXIH7BcnaR9itTCb4vy7jJfQJeQeUq0rwGkfd 0bWp2eeVNkAd5PUbgiTvWmJd8evjSs8Zx1Hd/G0EKsikAQKyVTptXn23lWOasQp1 UjNq3Yys7Cpf0wmhdI6yBkjDYxcD/7F38OpC/qjl6NjJ+zv7gDJKwRnLhqswTNnH ReiT+yEe6aEVyrOFdxkCa9x/O4sj355G+GpWYvwdjsvUDN9XgFpnBwCISPMq+hYP PfBT6VV0HgbV4HxZgz/h3eLsJ0qI5Uhwhh5NP9w==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-disposition,content-transfer-encoding, content-type,date,feedback-id,from,in-reply-to,message-id, mime-version,subject,to; Message-Instance: m=1; h=sha256:k905QqEBWMt0odXlnn0/X17taHKgju0C+1XRw0URv6M=:HGrOci4IVsuGKd9TJawlLgrEAYl5AFl3ifhyaZPp+CI=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEQSDubSbNR62m3l6ilMrqvf1VSYAOCfu2wqV3YgsqekamoGdG9s/hXejpWCpBH1o 00gWCWv7TpF7ZUWdhPkKgCweaUila6511IckyvLfqL4YVF7j0GmrKuk4fU5wr6LIifhRXO TnQb8tfw5zk0ZPhPtHYbHH7eS/DRnx+ANuFZBFmj3TVv8v7wnIn6E2IvK/FcREOWXcBsAo ORcwyQ4tKShhKQr7FYmcWJpMAPwjNrIwE1j//1gn5GezRwZtmVAPxNQ61KEcqxdcKbvk7c fb2RjTXVM/5fVriFtLfy52MJEAPLJw/3YSoHgtm/jz/DCakDIellCvm0YAffytqrfZ76LC fEztJsD3oTZnEPPbbVowPEDX6uuhmn7BwlkFCBJnZS7gHTmWtuNGDtmHDMPHlV4/yvjt1l 4h2HJz8k7WaOaGis2Y6HL30JDcmJ7i9y597ehgBht7rK+BqZDIYo7y0pMQqKN5m1ihSwZR 0QnxFVuesny4fva5ykjwO96PgGd+bfl6s2odsgtsDzAXAmnAxb4vJYWeVyPRQ+MbUFRoo7 R0d2l8tIZTdHogoBcLeJljyivmfC3ZXYKGe1uS18S2CNaNxcU/ew0piMIgr83AZODlsO+g ktv7k+C0yQJYIaJ6ggGafKzoreqDykFZqJJEVYkMDyo4Fmqdd9DbJ1Ub9dwQ X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 11 Nov 2026 10:41:37 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1794411694; bh=HGrOci4IVsuGKd9TJawlLgrEAYl5AFl3ifhyaZPp+CI=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=6SGJAUvLeUAFGOGVhPkTOPsoXE+8JYdMXntEgnT0rJ/JAHB7LF0O87QHByQm7vCoG PqQA6BOi2CGnwbXdbnqhpfUitfPewJRFdtxvEisYkZMimBVfg2r8/vvRbMCw79CuBs drMcbXtIJLcn7lyzkFYIrF0wJj+ptQx/wJD3WbNcNUBl8vTmXe5q6Z/U+eRbT/bF5t wg8YuRavFwMkOAjoUjJo9mt55FgCuPC+Mi+b5UJOFIn6ykA5wSeXEJK/Nx9jL2FJaR R14OZscQB3sFVQsDJR8F7Ed0r7AC8TDe+hbNlIavAUnsyYKbx9ODJ816d5D6SjjO/G lRWSQZLR3IGIg== Received: by ida.kurilemu.internal (Postfix, from userid 1000) id E706DB0012A; Wed, 11 Nov 2026 16:41:34 +0100 (CET) Date: Wed, 11 Nov 2026 16:41:34 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: shihao zhong Cc: Manu , Richard Guo , Richard Guo , pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: Don't trust NOT NULL on virtual generated columns of partitioned Message-ID: 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 2026-Oct-26, shihao zhong wrote: > Hi Manu, > > Thanks for testing the pg_upgrade, I forgot about that. > > I don't think the logic is wrong here, but maybe we can make some > improvement to the error message. v2 changes > > on the partitioned table of each column listed in the file > => > on the partitioned table of each column. In version 18 this is not > allowed on a table with CHECK constraints, so drop them first and > add them back afterwards. A list of the problem columns is in the > file I think the doc changes here are not ideal; they kinda suggest that there are numerous different generated column types for which you can have different generation expressions except for one special case -- rather than one case yes, one case no. How about something like this? If a parent column is a generated column, its child column must also - be a generated column of the same kind (stored or virtual); however, - the child column can have a different generation expression, except - that a virtual generated column of a partition must have the same - generation expression as the partitioned table. + be a generated column of the same kind (stored or virtual). + In addition, for virtual generated columns, the child column's + generation expression must be identical to that of the parent. + For stored generated columns, they are allowed to differ. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "I'm impressed how quickly you are fixing this obscure issue. I came from MS SQL and it would be hard for me to put into words how much of a better job you all are doing on [PostgreSQL]." Steve Midgley, http://archives.postgresql.org/pgsql-sql/2008-08/msg00000.php