Collected from the PG bugs email list.
|Reported by||Erika ONeal|
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.
|2019-08-27 15:07:01+00||PG Bug reporting form||BUG #15981: Alter table add column if not exists with constraint fails on constraint|
|2019-08-27 15:33:21+00||Tom Lane||Re: BUG #15981: Alter table add column if not exists with constraint fails on constraint|