Re: BUG #16870: ADD COLUMN IF NOT EXISTS with GENERATED ALWAYS AS IDENTITY can cause duplicate sequence - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #16870: ADD COLUMN IF NOT EXISTS with GENERATED ALWAYS AS IDENTITY can cause duplicate sequence
Date
Msg-id 2536806.1613576789@sss.pgh.pa.us
Whole thread Raw
In response to BUG #16870: ADD COLUMN IF NOT EXISTS with GENERATED ALWAYS AS IDENTITY can cause duplicate sequence  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> Hello, I'm getting unexpected behaviour with IDENTITY columns when running
> ALTER TABLE ADD COLUMN IF NOT EXISTS on them when they already exist.

Yeah, this is a known issue: the IF NOT EXISTS operates to skip the
actual creation of the column, but it fails to suppress secondary
operations such as adding indexes or serial sequences.  It's fixed
in v13, but the changes were too major to consider back-patching.

            regards, tom lane



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #16871: Insert with wrong key field, causing later crash of DB.
Next
From: Tom Lane
Date:
Subject: Re: BUG #16871: Insert with wrong key field, causing later crash of DB.