Re: Two sequences associated with one identity column

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Colin 't Hart <colinthart(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Two sequences associated with one identity column
Date: 2025-10-29 12:02:56
Message-ID: aQICcMvkp96kenL8@depesz.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Oct 29, 2025 at 12:27:44PM +0100, Colin 't Hart wrote:
> One of my clients has a database in which a single identity column
> (called "id" in that table) has two sequences associated with it(!)
> Both sequences display
> Sequence for identity column: <schema>.<table>.id
> when described with \d in psql.
> Trying to drop either sequence results in

Try:

ALTER SEQUENCE some_seq_name OWNED BY none;
DROP SEQUENCE some_seq_name;

Best regards,

depesz

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Colin 't Hart 2025-10-29 12:05:30 Re: Two sequences associated with one identity column
Previous Message Colin 't Hart 2025-10-29 11:27:44 Two sequences associated with one identity column