Re: Column value derived from generated column in INSERT? - Mailing list pgsql-general

From David G. Johnston
Subject Re: Column value derived from generated column in INSERT?
Date
Msg-id CAKFQuwZpq-hZ-zBN8KhzF3Ke3bheHHpp_f=tEkH30+JTXtaMsg@mail.gmail.com
Whole thread Raw
In response to Column value derived from generated column in INSERT?  (Mark Raynsford <co+org.postgresql@io7m.com>)
Responses Re: Column value derived from generated column in INSERT?
List pgsql-general
On Wed, Oct 19, 2022 at 10:36 AM Mark Raynsford <co+org.postgresql@io7m.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.

pgsql-general by date:

Previous
From: Mark Raynsford
Date:
Subject: Column value derived from generated column in INSERT?
Next
From: Philip Semanchuk
Date:
Subject: Custom function ROWS hint ignored due to inlining?