pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: spam@bit.bucket
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19019: Feature Request: allow the use of column reference in DEFAULT expression
Date: Thu, 14 Aug 2025 06:53:28 +0200
Message-ID: <8950df651b0dbaee287bbd70dc057f696313d4d4.camel@cybertec.at> (raw)
In-Reply-To: <19019-962b23dc13723881@postgresql.org>
References: <19019-962b23dc13723881@postgresql.org>

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





view thread (3+ messages)

Message-ID: <8950df651b0dbaee287bbd70dc057f696313d4d4.camel@cybertec.at>
Permalink:  ../8950df651b0dbaee287bbd70dc057f696313d4d4.camel@cybertec.at/
Also on:    postgresql.org/message-id/8950df651b0dbaee287bbd70dc057f696313d4d4.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: laurenz.albe@cybertec.at, spam@bit.bucket, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #19019: Feature Request: allow the use of column reference in DEFAULT expression
  In-Reply-To: <8950df651b0dbaee287bbd70dc057f696313d4d4.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox