Search Postgresql Archives

Re: Issues with upserts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/13/22 07:58, André Hänsel wrote:
Jeremy Smith wrote:

CREATE TABLE t (

     id serial PRIMARY KEY,

     name text NOT NULL UNIQUE,

     address text NOT NULL

);


This will yield “8”, showing that new sequence numbers have been generated for each attempt.


If running out of id's is a concern use bigserial instead of serial as it uses bigint:

bigint 	-9223372036854775808 to +9223372036854775807

vs

integer for serial:

integer -2147483648 to +2147483647

--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux