| From: | pabloa98 <pabloa98(at)gmail(dot)com> | 
|---|---|
| To: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> | 
| Cc: | "Peter J(dot) Holzer" <hjp-pgsql(at)hjp(dot)at>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org> | 
| Subject: | Re: Could postgres12 support millions of sequences? (like 10 million) | 
| Date: | 2020-03-21 23:41:05 | 
| Message-ID: | CAEjudX560swSOL8xj=qziD39SVV4=7qh4HWjwWfQuhVC1LVKpw@mail.gmail.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
On Sat, Mar 21, 2020 at 4:37 PM Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:
>
> > Anyway, It will be awesome if we have a sequence data type in a future
> > version of postgresql. They will solve a lot of problems similar to this
> > one.
>
> Actually there are already two:
>
> https://www.postgresql.org/docs/12/datatype-numeric.html#DATATYPE-SERIAL
>
> https://www.postgresql.org/docs/12/sql-createtable.html
> "
> GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY [ ( sequence_options ) ]
>
>      This clause creates the column as an identity column. It will have
> an implicit sequence attached to it and the column in new rows will
> automatically have values from the sequence assigned to it.
> "
>
> What you want is a built in method to pull from different sequences
> depending on the value of another column or values from multiple columns
> in the same table.
>
> Exactly. That will work fine too.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2020-03-22 03:25:53 | Re: Explain says 8 workers planned, only 1 executed | 
| Previous Message | Adrian Klaver | 2020-03-21 23:36:56 | Re: Could postgres12 support millions of sequences? (like 10 million) |