Re: Advice on Contiguous IDs

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Brian McKiernan <brian(dot)mckiernan(at)firstcircle(dot)com>
Cc: pgsql-docs(at)postgresql(dot)org
Subject: Re: Advice on Contiguous IDs
Date: 2018-01-09 16:57:50
Message-ID: CAKFQuwbPWiAqu63fs3Ldx_ShaeBTYVmuGhR-E=yGDPVFv2qWXw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Tue, Jan 9, 2018 at 2:06 AM, Brian McKiernan <
brian(dot)mckiernan(at)firstcircle(dot)com> wrote:

> 1) What event would cause the CACHE clause in CREATE SEQUENCE to make an
> out of sequence next number?
>

​None - it will always issue the next sequential value when asked. But the
transaction asking doesn't have to use the provided value as the PK for the
table or, and even if it does, if the transaction fails and rolls-back the
sequence value it received is discarded/lost.​

​David J.​

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Steve Atkins 2018-01-09 17:14:38 Re: Advice on Contiguous IDs
Previous Message Vik Fearing 2018-01-09 16:53:57 Re: libpq options