public inbox for [email protected]  
help / color / mirror / Atom feed
From: Peter Eisentraut <[email protected]>
To: jian he <[email protected]>
To: PostgreSQL Hackers <[email protected]>
Subject: Re: information_schema.view attgenerated
Date: Wed, 18 Sep 2024 10:09:38 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CACJufxHO3=BA=9S1RAG3=Rp_E=C_ShO9UFfTniEHdMTp4mTS9A@mail.gmail.com>
References: <CACJufxHO3=BA=9S1RAG3=Rp_E=C_ShO9UFfTniEHdMTp4mTS9A@mail.gmail.com>

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.?







view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: information_schema.view attgenerated
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox