Should we document how column DEFAULT expressions work?

From: James Coleman <jtc331(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Should we document how column DEFAULT expressions work?
Date: 2024-06-25 20:51:05
Message-ID: CAAaqYe-wQPbchCUE7pocPNEQ3PMY8a98Txmxc7q0+FvXtk1vvg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

It's possible I'm the only one who's been in this situation, but I've
multiple times found myself explaining to a user how column DEFAULT
expressions work: namely how the quoting on an expression following
the keyword DEFAULT controls whether or not the expression is
evaluated at the time of the DDL statement or at the time of an
insertion.

In my experience this is non-obvious to users, and the quoting makes a
big difference.

Is this something that we should document explicitly? I don't see it
called out in the CREATE TABLE reference page, but it's possible I'm
missing something.

Thanks,
James Coleman

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-06-25 20:57:17 Re: Backporting BackgroundPsql
Previous Message Daniel Gustafsson 2024-06-25 20:47:11 Re: Backporting BackgroundPsql