Re: wrong comments in rewriteTargetListIU - Mailing list pgsql-hackers

From jian he
Subject Re: wrong comments in rewriteTargetListIU
Date
Msg-id CACJufxE35H3idcT2w61LAwJ4=5ztnR8tmupL=kocJUg3PTsNVA@mail.gmail.com
Whole thread Raw
In response to wrong comments in rewriteTargetListIU  (jian he <jian.universality@gmail.com>)
List pgsql-hackers
On Tue, Jun 17, 2025 at 7:42 PM Peter Eisentraut <peter@eisentraut.org> wrote:
>
> However, I see your point that it contrasts with the attidentity code
> just above.
>
> Perhaps a way to resolve this would be to rewrite the comment something
> like:
>
>      /*
>       * Although inserting into a GENERATED BY DEFAULT identity column
>       * is allowed, apply the default if OVERRIDING USER VALUE is
>       * specified.
>       */
>      if (att_tup->attidentity == ATTRIBUTE_IDENTITY_BY_DEFAULT &&
>          override == OVERRIDING_USER_VALUE)
>          apply_default = true;
>
>      /*
>       * Can only insert DEFAULT into generated columns.  (The OVERRIDING
>       * clause does not apply to generated columns, so we don't consider
>       * it here.)
>       */
>      if (att_tup->attgenerated && !apply_default)
>      {
>
I think this comment is better than the master comments.

the master comments
            /*
             * Can only insert DEFAULT into generated columns, regardless of
             * any OVERRIDING clauses.
             */
as a non-native English speaker, i interpret this as it implies that
generated columns
can have OVERRIDING clauses in some scenarios.



pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: BackendKeyData is mandatory?
Next
From: Aleksander Alekseev
Date:
Subject: Re: --enable-{debug,cassert} should also activate --enable-depend