pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: e.oneal89@gmail.com
Subject: BUG #15981: Alter table add column if not exists with constraint fails on constraint
Date: Tue, 27 Aug 2019 15:07:01 +0000
Message-ID: <15981-1c21384db6d3e7f1@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      15981
Logged by:          Erika ONeal
Email address:      e.oneal89@gmail.com
PostgreSQL version: 11.5
Operating system:   Debian
Description:        

SQL to reproduce:

`CREATE TABLE test(id uuid PRIMARY KEY);
ALTER TABLE test ADD IF NOT EXISTS id uuid PRIMARY KEY;`

Output: `NOTICE:  column "id" of relation "test" already exists, skipping
ERROR:  multiple primary keys for table "test" are not allowed`

Expected Outcome: If the column already exists, it should not attempt to
index it with the column constraint. Or if that is the correct behavior, the
documentation does not reflect that.



view thread (2+ messages)  latest in thread

Message-ID: <15981-1c21384db6d3e7f1@postgresql.org>
Permalink:  ../15981-1c21384db6d3e7f1@postgresql.org/
Also on:    postgresql.org/message-id/15981-1c21384db6d3e7f1@postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, e.oneal89@gmail.com
  Subject: Re: BUG #15981: Alter table add column if not exists with constraint fails on constraint
  In-Reply-To: <15981-1c21384db6d3e7f1@postgresql.org>
  References: <15981-1c21384db6d3e7f1@postgresql.org>

* 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