From: Alexey Dokuchaev <danfe@nsu.ru>
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general@postgresql.org
Subject: Re: (2^63 - 1)::bigint => out of range? (because of the double precision)
Date: Sat, 9 Jun 2018 22:36:26 +0700
Message-ID: <20180609153626.GA15452@regency.nsu.ru> (raw)
In-Reply-To: <452406d5-fc36-f62e-1675-bf7773e2657b@aklaver.com>
References: <20180608172323.GA32312@regency.nsu.ru>
<f1014b70-e418-58de-c937-9e81d41c7811@aklaver.com>
<20180609122425.GA2680@regency.nsu.ru>
<452406d5-fc36-f62e-1675-bf7773e2657b@aklaver.com>
On Sat, Jun 09, 2018 at 07:20:17AM -0700, Adrian Klaver wrote:
> On 06/09/2018 05:24 AM, Alexey Dokuchaev wrote:
> >OK, but what about highly volatile tables for come-and-go type of things?
> >Think of a session pool, or task queue. I want to use NO CYCLE for this
> >kind of tables as it would allow me to never worry about hitting "nextval:
> >reached maximum value of sequence" error, recycle ids (because they come
> >and go), and still be safe because PK constraint protects me. Any flaws
> >in this vision of mine?
>
> Assuming you meant CYCLE not NO CYCLE, I see no issue.
Oh, mea culpa, I meant CYCLE of course (in the quoted paragraph above).
> If you do use a sequence with NO CYCLE you can use ALTER SEQUENCE some_seq
> RESTART to reset it:
> https://www.postgresql.org/docs/10/static/sql-altersequence.html
I understand that I can reset it; the idea was to minimize the table and
sequence maintenance while allowing it to work, well, forever. Hence the
CYCLE idea. Anyway, I've heard you, thanks Adrian.
./danfe
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: danfe@nsu.ru, adrian.klaver@aklaver.com
Subject: Re: (2^63 - 1)::bigint => out of range? (because of the double precision)
In-Reply-To: <20180609153626.GA15452@regency.nsu.ru>
References: <20180608172323.GA32312@regency.nsu.ru> <f1014b70-e418-58de-c937-9e81d41c7811@aklaver.com> <20180609122425.GA2680@regency.nsu.ru> <452406d5-fc36-f62e-1675-bf7773e2657b@aklaver.com> <20180609153626.GA15452@regency.nsu.ru>
* 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