Re: nextval parameter is not clear - Mailing list pgsql-docs

From Kirk Wolak
Subject Re: nextval parameter is not clear
Date
Msg-id CACLU5mTmEieU-uTF6bNm9T5Y94gd1g_cgz_JDLz6Qw36RjcBHQ@mail.gmail.com
Whole thread Raw
In response to Re: nextval parameter is not clear  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: nextval parameter is not clear  (Kirk Wolak <wolakk@gmail.com>)
List pgsql-docs
On Fri, Nov 25, 2022 at 9:58 AM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Fri, Nov 25, 2022 at 12:40 AM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
On Thu, 2022-11-24 at 15:50 -0500, Kirk Wolak wrote:
>
> David, let me see how that looks.  From an approach standpoint, I am hearing:
I think it would be better to create the sequence explicitly and use
it in the DEFAULT clause of a column definition.

I wasn't too happy with that comment when I wrote it either.

I would probably do without the DEFAULT if going the explicit route (but it isn't a deal breaker).

However, I remembered that we have:

pg_get_serial_sequence ( table text, column text ) → text

I'd be inclined to stay with the GENERATED example but incorporate that function call into the other examples.

Regardless of the above choice for the example, it seems appropriate for this page, somewhere, to mention this function and link to its page.

I'd even argue for moving that function definition here.

David J.

Okay, I've really reworked the example, and it all tests out.
I took the advice of Laurenz about the separate section outside the table.
I did not move the function, it seemed alphabetical where it was (easy enough to move), but I did use that function twice!

Break out the RED ink and let me know what you think!

Kirk


 
Attachment

pgsql-docs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: temporary file size clarification
Next
From: Kirk Wolak
Date:
Subject: Re: nextval parameter is not clear