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: jsturgeon@novetta.com
Subject: BUG #16088: Multiple foreigh keys created on "ALTER TABLE" command
Date: Tue, 29 Oct 2019 15:26:19 +0000
Message-ID: <16088-d8dbfda0fb069e93@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      16088
Logged by:          Jess Sturgeon
Email address:      jsturgeon@novetta.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



view thread (2+ messages)  latest in thread

Message-ID: <16088-d8dbfda0fb069e93@postgresql.org>
Permalink:  ../16088-d8dbfda0fb069e93@postgresql.org/
Also on:    postgresql.org/message-id/16088-d8dbfda0fb069e93@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, jsturgeon@novetta.com
  Subject: Re: BUG #16088: Multiple foreigh keys created on "ALTER TABLE" command
  In-Reply-To: <16088-d8dbfda0fb069e93@postgresql.org>
  References: <16088-d8dbfda0fb069e93@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