Re: Column value derived from generated column in INSERT?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Mark Raynsford <co+org(dot)postgresql(at)io7m(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Column value derived from generated column in INSERT?
Date: 2022-10-19 18:58:07
Message-ID: CAKFQuwZpq-hZ-zBN8KhzF3Ke3bheHHpp_f=tEkH30+JTXtaMsg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Oct 19, 2022 at 10:36 AM Mark Raynsford <co+org(dot)postgresql(at)io7m(dot)com>
wrote:

> insert into t (y) values (t.x * 2);
>
> I can think of various ways to do it with multiple statements, but a
> single statement would be preferable.
>
>
No, by extension of the documented constraint: "The generation expression
can refer to other columns in the table, but not other generated columns."

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Philip Semanchuk 2022-10-19 19:02:42 Custom function ROWS hint ignored due to inlining?
Previous Message Mark Raynsford 2022-10-19 17:32:25 Column value derived from generated column in INSERT?