pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: dperham@opex.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16805: "ALTER TABLE ... ADD COLUMN IF NOT EXISTS ... PRIMARY KEY" fails if column exists and is the primary
Date: Tue, 05 Jan 2021 10:45:02 -0500
Message-ID: <3379436.1609861502@sss.pgh.pa.us> (raw)
In-Reply-To: <16805-4e3f8b42fbe7622c@postgresql.org>
References: <16805-4e3f8b42fbe7622c@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> ALTER TABLE IF EXIST foo ADD COLUMN IF NOT EXISTS id BIGSERIAL PRIMARY KEY; 
> Fails if "id" exists and is already the primary key.

Yeah, known problem.  This is fixed in v13, but the fix seemed too
invasive for a back-patch (see [1] and follow-on fixes).

			regards, tom lane

[1] https://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=1281a5c90





view thread (3+ messages)

Message-ID: <3379436.1609861502@sss.pgh.pa.us>
Permalink:  ../3379436.1609861502@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3379436.1609861502@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, dperham@opex.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #16805: "ALTER TABLE ... ADD COLUMN IF NOT EXISTS ... PRIMARY KEY" fails if column exists and is the primary
  In-Reply-To: <3379436.1609861502@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