Re: Identity and Sequence

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Michael Corey <michael(dot)corey(dot)ap(at)nielsen(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Identity and Sequence
Date: 2024-02-16 18:10:23
Message-ID: CAKFQuwarjmGVfHiSRr3yZ0JAVzBr+qXd+nYgY3N4OBJWHBUrdg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Feb 16, 2024 at 10:24 AM Michael Corey <michael(dot)corey(dot)ap(at)nielsen(dot)com>
wrote:

> By explicitly making a column an IDENTITY column it is going to make a
> sequence behind the scenes even if one with a similar name exists. I tried
> and it created part_tab_part_id_seq1. Is there no way to have it use the
> original part_tab_part_id_seq?
>

No, the fact that there is even a sequence is mostly an implementation
detail you shouldn't be concerned with.

> How do I get the data and the sequence in sync?
>
>
That would be why the alter table command has a bunch of keywords and
values as part of it. So you can modify the values to be what you need.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2024-02-16 18:16:58 Re: Identity and Sequence
Previous Message Michael Corey 2024-02-16 17:23:36 Re: Identity and Sequence