BUG #16088: Multiple foreigh keys created on "ALTER TABLE" command

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: jsturgeon(at)novetta(dot)com
Subject: BUG #16088: Multiple foreigh keys created on "ALTER TABLE" command
Date: 2019-10-29 15:26:19
Message-ID: 16088-d8dbfda0fb069e93@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16088
Logged by: Jess Sturgeon
Email address: jsturgeon(at)novetta(dot)com
PostgreSQL version: 12.0
Operating system: RHEL 7.7
Description:

If you run this command multiple times:

ALTER TABLE myschema.mytable ADD IF NOT EXISTS mycolumn uuid REFERENCES
myschema.mytable2(userid);

It adds the column once, but adds a duplicate FOREIGN KEY each time. I had
over 59 keys while debugging my schema definition :)

This happens in PG11.5 and PG12 for me, both on RHEL 7.7

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-10-29 15:37:05 Re: BUG #16088: Multiple foreigh keys created on "ALTER TABLE" command
Previous Message Tom Lane 2019-10-29 15:26:14 Re: BUG #16087: Segmentation fault on ALTER TABLE