pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: sean@respax.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16870: ADD COLUMN IF NOT EXISTS with GENERATED ALWAYS AS IDENTITY can cause duplicate sequence
Date: Wed, 17 Feb 2021 10:46:29 -0500
Message-ID: <2536806.1613576789@sss.pgh.pa.us> (raw)
In-Reply-To: <16870-edb7e5bae3587d01@postgresql.org>
References: <16870-edb7e5bae3587d01@postgresql.org>

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





view thread (2+ messages)

Message-ID: <2536806.1613576789@sss.pgh.pa.us>
Permalink:  ../2536806.1613576789@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2536806.1613576789@sss.pgh.pa.us

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, sean@respax.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #16870: ADD COLUMN IF NOT EXISTS with GENERATED ALWAYS AS IDENTITY can cause duplicate sequence
  In-Reply-To: <2536806.1613576789@sss.pgh.pa.us>

* 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