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 1tIT5S-00EWgl-NU for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Dec 2024 13:37:10 +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 1tIT5Q-009p7g-6K for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Dec 2024 13:37:09 +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.94.2) (envelope-from ) id 1tIT5P-009p7X-S6 for pgsql-hackers@lists.postgresql.org; Tue, 03 Dec 2024 13:37:09 +0000 Received: from fhigh-a2-smtp.messagingengine.com ([103.168.172.153]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIT5O-000psv-1g for pgsql-hackers@postgresql.org; Tue, 03 Dec 2024 13:37:08 +0000 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.phl.internal (Postfix) with ESMTP id 4B3AF114014E; Tue, 3 Dec 2024 08:37:04 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Tue, 03 Dec 2024 08:37:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm3; t=1733233024; x=1733319424; bh=BLk5MYmLxtp4g8HvvCcWpNMYqRiKSo11 8t1w8Zn53Dk=; b=EaDAfK9lwlIusHlhh35vl+Xr84KnMqihajasCanI3xog6jhu VklhL1VDld3KQONWTsfA+r4R1EVQARDgiRjNWQ140YXk6PoiemPYYJR/AN8ivell hjYubIoiafguuv5h4MhoOZEe52tv4jGjcghzQvx6BbCET7BqTyCJp+IHcMTPkBgi SIFCJ8R+Tm5PkUxY5MPTvsaLaZXbqAECaI1cF3/IKgygZJx2HAj2jWT24RwRxAVh 98QmZgcB0AX2sGbdVP/Jh9G86QMO25/ww61yNUt7hbDYzI3BmJ+dfnu44EgAfvQe ASY+gxRFS8HeHQKwxiljrjn6M36AnyAnmGFW7w== 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 :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1733233024; x= 1733319424; bh=BLk5MYmLxtp4g8HvvCcWpNMYqRiKSo118t1w8Zn53Dk=; b=C QQ+JpFo63JaEft1bKQCZejJB/OpIWoHNuCnrWqE4SFgrR+Qbaz/3SkLDKCfDuxhV 1khx+Q4I1DIkXBXTIEhFXOX17GmzIRcux6ybW95yGsXm5j5DSNo+F4uBZ6wfwve2 2SN3TBl2z3sdwagwFZwk/5a04fiZj6KRATm9NC45oY7k2YPmxCXnv1QzyQZLiJ/j CyhXP6EI8fWT/cn3mzbPFWE7GcgiVWcsjmpMkRfgvHmTgAd62ZqBiYjSy2mdU81+ uIcIMYhRuFTquZhjL3xwX89b1rcKpvkWG+A9ke+4knpkvvDi13gFgiPUA/IB1e91 mCCLkyUPQ4BobLhrah+Cw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrieefgddviecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefkffggfgfuhffvvehfjggtgfesthekredttddvjeen ucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhesvghishgvnh htrhgruhhtrdhorhhgqeenucggtffrrghtthgvrhhnpedvjeeihffhvdefheevleekveeu jefhieduueeljeekieejieegfefhtdfhleejgeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrsegvihhsvghnthhrrghuthdrohhr ghdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepjh hirghnrdhunhhivhgvrhhsrghlihhthiesghhmrghilhdrtghomhdprhgtphhtthhopehp ghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhope guvggrnhdrrgdrrhgrshhhvggvugesghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 3 Dec 2024 08:37:03 -0500 (EST) Message-ID: Date: Tue, 3 Dec 2024 14:37:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Virtual generated columns From: Peter Eisentraut To: jian he Cc: pgsql-hackers , Dean Rasheed References: <732a9543-0312-4f0c-a471-857b507a3546@eisentraut.org> <0f811f71-8c86-4e1b-b3bb-6a535674a440@eisentraut.org> <09800cb1-43aa-4239-8918-46b71ede4900@eisentraut.org> <536b281b-2cb3-4477-971f-c64838bc6263@eisentraut.org> <41f64e3c-db80-43b2-9a21-7ecc515f889f@eisentraut.org> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 28.11.24 10:35, Peter Eisentraut wrote: > On 12.11.24 17:08, Peter Eisentraut wrote: >> On 11.11.24 12:37, jian he wrote: >>> On Wed, Nov 6, 2024 at 12:17 AM Peter Eisentraut >>> wrote: >>>> >>>> New patch version.  I've gone through the whole thread again and looked >>>> at all the feedback and various bug reports and test cases and made >>>> sure >>>> they are all addressed in the latest patch version.  (I'll send some >>>> separate messages to respond to some individual messages, but I'm >>>> keeping the latest patch here.) >>> >>> just quickly note the not good error message before you rebase. >>> >>> src7=# create domain d_fail as int4 constraint cc GENERATED ALWAYS AS >>> (2) ; >>> ERROR:  unrecognized constraint subtype: 4 >>> src7=# create domain d_fail as int4 constraint cc GENERATED ALWAYS AS >>> (2) stored; >>> ERROR:  unrecognized constraint subtype: 4 >>> src7=# create domain d_fail as int4 constraint cc GENERATED ALWAYS AS >>> (2) virtual; >>> ERROR:  unrecognized constraint subtype: 4 >>> >>> reading gram.y, typedef struct Constraint seems cannot distinguish, we >>> are creating a domain or create table. >>> I cannot found a way to error out in gram.y. >>> >>> so we have to error out at DefineDomain. >> >> This appears to be a very old problem independent of this patch.  I'll >> take a look at fixing it. > > Here is a patch. > > I'm on the fence about taking out the default case.  It does catch the > missing enum values, and I suppose if the struct arrives in > DefineDomain() with a corrupted contype value that is none of the enum > values, then we'd just do nothing with it.  Maybe go ahead with this, > but for backpatching leave the default case in place? I have committed this, just to master for now.