PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID15981
PG Version11.5
OSDebian
Opened2019-08-27 15:07:01+00
Reported byErika ONeal
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      15981
Logged by:          Erika ONeal
Email address:      (redacted)
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.

Messages

DateAuthorSubject
2019-08-27 15:07:01+00PG Bug reporting formBUG #15981: Alter table add column if not exists with constraint fails on constraint
2019-08-27 15:33:21+00Tom LaneRe: BUG #15981: Alter table add column if not exists with constraint fails on constraint