Re: BUG #19019: Feature Request: allow the use of column reference in DEFAULT expression

Laurenz Albe <laurenz.albe@cybertec.at>

From: Laurenz Albe <laurenz.albe@cybertec.at>
To: spam@bit.bucket, pgsql-bugs@lists.postgresql.org
Date: 2025-08-14T04:53:28Z
Lists: 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