[postgresSQL] [bug] Two or more different types of constraints with same name creates ambiguity while drooping.

From: Harshal Dhumal <harshal(dot)dhumal(at)enterprisedb(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [postgresSQL] [bug] Two or more different types of constraints with same name creates ambiguity while drooping.
Date: 2016-03-30 06:16:56
Message-ID: CAFiP3vyDeeWiy7gqAig2Hr_PmHuma2ia9on882pED6n1dMPjng@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Team,

While I was working on constraints node in pgadmin4 I came across this
scenario. Please let me know if it's correct behaviour or a bug.

*Scenario:*

If we create two different type of constrains (lets say primary key and
foreign key) on same table with same name (lets say 'key' ) then its shows
same drop query for both constrains.
e.g.

ALTER TABLE public."Test_tbl" DROP CONSTRAINT key;

If we execute above query for first time then it drops primary key first
and if execute same query for second time then it drops foreign key.

Also in pgadmin3 if we right click on foreign key and try to drop it, it
drops primary key and not the foreign key. We have to drop foreign key
twice to actually drop the foreign key if primary key with same was there.

*Note: Create foreign key first and then primary key with same name.*

Regards

--
*Harshal Dhumal*
*Software Engineer *

EenterpriseDB <http://www.enterprisedb.com>

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2016-03-30 06:22:31 Re: Proposal: "Causal reads" mode for load balancing reads without stale data
Previous Message Kyotaro HORIGUCHI 2016-03-30 05:48:15 Re: IF (NOT) EXISTS in psql-completion