From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: duplicate key value violates unique constraint
Date: Sat, 7 Mar 2020 15:13:26 -0600
Message-ID: <e4c5d934-038b-735b-ba53-88844ae7ed15@gmail.com> (raw)
In-Reply-To: <CAHaowgV2rKK3L30DcjbEy8-L+Pz5qyv8inpsr=y_=qxuXULzLw@mail.gmail.com>
References: <CAHaowgV2rKK3L30DcjbEy8-L+Pz5qyv8inpsr=y_=qxuXULzLw@mail.gmail.com>
Asking the same question on multiple lists is strongly frowned upon.
On 3/7/20 1:29 PM, Ashkar Dev wrote:
> Hi all,
>
> how to fix a problem, suppose there is a table with id and username
>
> if I set the id to bigint so the limit is 9223372036854775807
> if I insert for example 3 rows
> id username
> -- --------------
> 1 abc
> 2 def
> 3 ghi
>
> if I delete all rows and insert one another it is like
>
> id username
> -- --------------
> 4 jkl
>
>
> So it doesn't start again from non-available id 1, so what is needed to do
> to make the new inserts go into non-available id numbers?
--
Angular momentum makes the world go 'round.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: ronljohnsonjr@gmail.com
Subject: Re: duplicate key value violates unique constraint
In-Reply-To: <e4c5d934-038b-735b-ba53-88844ae7ed15@gmail.com>
References: <CAHaowgV2rKK3L30DcjbEy8-L+Pz5qyv8inpsr=y_=qxuXULzLw@mail.gmail.com> <e4c5d934-038b-735b-ba53-88844ae7ed15@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox