Re: Issues with upserts - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Issues with upserts
Date
Msg-id d03e21be-5c88-0085-e485-405d09a60727@aklaver.com
Whole thread Raw
In response to RE: Issues with upserts  (André Hänsel <andre@webkr.de>)
List pgsql-general
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@aklaver.com



pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Issues with upserts
Next
From: Bryn Llewellyn
Date:
Subject: Re: Seems to be impossible to set a NULL search_path