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 1sqpkt-00DE8L-Uj for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Sep 2024 08:09:44 +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 1sqpkt-005sO2-GD for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Sep 2024 08:09:43 +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 1sqpkt-005sNs-5x for pgsql-hackers@lists.postgresql.org; Wed, 18 Sep 2024 08:09:43 +0000 Received: from fhigh5-smtp.messagingengine.com ([103.168.172.156]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sqpkq-001lwR-6y for pgsql-hackers@lists.postgresql.org; Wed, 18 Sep 2024 08:09:41 +0000 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id B52C811402C9; Wed, 18 Sep 2024 04:09:39 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Wed, 18 Sep 2024 04:09:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=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=1726646979; x=1726733379; bh=s0p/41Vc4qq/dtg+qmjykvMZKRh6bTywGU5Ps76mlEM=; b= rX4cEnShEvDe/gBTLXNrIxR0pbB4YY/kkE2JkzJLmtB92lMxnYV9dyWiz3G7nKYg 1Sr4i6HRnN6T300qeHSn6kqpg92W/gAB8H36FO3c4IsYA2IueEjVjJtHOl6DU4Mk jdJY2hycIZVdNF1cDhMbokRwgZiVzVo+VH9myRRqXOzA1HkQmZnhb1Yak/NUQVwc FYvimARGbduJ8reUFW6iENm4LnRXXJCrAjZirPNK6/ExZKRBQuTok07/HY+JaRtf kpz4dJbonVPkERlax2A86chIESrbA5uKBlsCk4DvZ0migS98ZrOuplW37efgKMZr sFjZa+nWoTAp7xtMPK8pZw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1726646979; x= 1726733379; bh=s0p/41Vc4qq/dtg+qmjykvMZKRh6bTywGU5Ps76mlEM=; b=P e5Ud4HWJqOyKWwbH1D/bvE/a/xwhI77FhGhlF/gFrO5+h9nh5m90+vVejE3hUbKG BaaAmWF4/FX1C0qqg5ymlwpnYElnJFiuZG0RfhqXZAgExbca8p9hQROWxw655NnX UmZRJNOg/Wz7hFI6JuvGHVrs564FOM2phCmxr3jWayAQtTTml6LS6ukcxJ8tTHoE cnq0VQeLrMCXzp5M7Z8vurl66QBDMmqXXtnpz5UAI4y/TJraTOrdRm9ErW//LIfh 41yhpS/2jh5ZpsSp8xkf0J7vk4T3wpiyyCiRAyy57R1WssacvLGL3KK1b4tOOyXI YjE/S+eVMQV8KFvRly8Ww== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudekkedguddvlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpefrvghtvghrucfgihhsvghnthhrrghuthcuoehpvghtvghrsegvihhsvg hnthhrrghuthdrohhrgheqnecuggftrfgrthhtvghrnhepheeivdfhuefhueeggfefheeg jedtveeuhfethfeufedvudfgtdeuhefgfeduhfffnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhesvghishgvnhhtrhgruhhtrdho rhhgpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhope hjihgrnhdruhhnihhvvghrshgrlhhithihsehgmhgrihhlrdgtohhmpdhrtghpthhtohep phhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 18 Sep 2024 04:09:38 -0400 (EDT) Message-ID: <782d873b-5e18-4de4-8e5c-ab619f59d71a@eisentraut.org> Date: Wed, 18 Sep 2024 10:09:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: information_schema.view attgenerated To: jian he , PostgreSQL Hackers References: Content-Language: en-US From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 16.09.24 06:12, jian he wrote: > hi. > one minor issue in src/backend/catalog/information_schema.sql > /* > * 6.22 > * COLUMNS view > */ > CREATE VIEW columns .... > > > CAST(CASE WHEN a.attgenerated = '' THEN pg_get_expr(ad.adbin, > ad.adrelid) END AS character_data) AS column_default, > can change to > CAST(CASE WHEN a.attgenerated = '' AND a.atthasdef THEN > pg_get_expr(ad.adbin, ad.adrelid) END AS character_data) AS > column_default, > > > CAST(CASE WHEN a.attgenerated <> '' THEN 'ALWAYS' ELSE 'NEVER' END AS > character_data) AS is_generated, > can change to > CAST(CASE WHEN a.attgenerated <> '' AND a.atthasdef THEN 'ALWAYS' ELSE > 'NEVER' END AS character_data) AS is_generated, > > CAST(CASE WHEN a.attgenerated <> '' THEN pg_get_expr(ad.adbin, > ad.adrelid) END AS character_data) AS generation_expression, > can change to > CAST(CASE WHEN a.attgenerated <> '' AND a.atthasdef THEN > pg_get_expr(ad.adbin, ad.adrelid) END AS character_data) AS > generation_expression, > > > i guess, it will have some minor speed up, also more accurate. I'm having a hard time interpreting this report. Could you be more clear about what is the existing code, and what is the code you are proposing as new.?