Re: BUG #19019: Feature Request: allow the use of column reference in DEFAULT expression - Mailing list pgsql-bugs

From Laurenz Albe
Subject Re: BUG #19019: Feature Request: allow the use of column reference in DEFAULT expression
Date
Msg-id 8950df651b0dbaee287bbd70dc057f696313d4d4.camel@cybertec.at
Whole thread Raw
In response to BUG #19019: Feature Request: allow the use of column reference in DEFAULT expression  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
On Wed, 2025-08-13 at 11:36 +0000, PG Bug reporting form wrote:
> As it is possible in some other SQL RDBMS, it would be useful to allow the
> use of column reference in DEFAULT expression.

You can use a BEFORE INSERT trigger for that.

If you allow columns in a DEFAULT expression, would that use the column value
from before or after the BEFORE triggers run?

Yours,
Laurenz Albe



pgsql-bugs by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: BUG #19018: high memory usage and "stack depth limit exceeded", with GiST index on ltree
Next
From: Amit Kapila
Date:
Subject: Re: BUG #18988: DROP SUBSCRIPTION locks not-yet-accessed database