Re: Should we document how column DEFAULT expressions work?

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, James Coleman <jtc331(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Should we document how column DEFAULT expressions work?
Date: 2024-06-26 23:54:01
Message-ID: CAApHDvqShXhOat03iEV1VqXM68DBJ+zM95Ghbu0rcqs8KnhQQQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 26 Jun 2024 at 17:36, David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>
> On Tue, Jun 25, 2024 at 9:50 PM David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
>> FWIW, I disagree that we need to write anything about that in this
>> part of the documentation. I think any argument for doing this could
>> equally be applied to something like re-iterating what the operator
>> precedence rules for arithmetic are, and I don't think that should be
>> mentioned.
>
>
> I disagree on this equivalence. The time literals are clear deviations from expected behavior. Knowing operator precedence rules, they apply everywhere equally. And we should document the deviations directly where they happen. Even if it's just a short link back to the source that describes the deviation. I'm fine with something less verbose pointing only to the data types page, but not with nothing.

Are you able to share what the special behaviour is with DEFAULT
constraints and time literals that does not apply everywhere equally?

Maybe I'm slow on the uptake, but I've yet to see anything here where
time literals act in a special way DEFAULT constraints. This is why I
couldn't understand why we should be adding documentation about this
under CREATE TABLE.

I'd be happy to reconsider or retract my argument if you can show me
what I'm missing.

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-06-27 00:11:03 Re: Should we document how column DEFAULT expressions work?
Previous Message Tom Lane 2024-06-26 23:38:25 Re: Should we document how column DEFAULT expressions work?