pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: samfelder17@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18917: "Foreign key constraint drop fails with 'column is not in index' unless pg_constraint is queried
Date: Wed, 07 May 2025 21:50:34 -0400
Message-ID: <104861.1746669034@sss.pgh.pa.us> (raw)
In-Reply-To: <18917-fea6ac4ccec4e24a@postgresql.org>
References: <18917-fea6ac4ccec4e24a@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> when trying to drop a foreign key constraint with an existing index that
> hasn't been used, you need to make a query against constraint table to get
> it working. see below for psql sequence of events
> ```
> mydb=> begin;
> BEGIN
> mydb=*> CREATE INDEX IF NOT EXISTS "child_table_parent_id_idx" ON
> "child_table"("parent_id");
> CREATE INDEX
> ... etc ...

This test case is incomplete on its face. (How was the table created?
Where did "child_table_parent_id_fkey" come from?)  So it's hard to
tell what's going on, much less fix it.  Could we have a complete
reproducer starting from an empty database?

			regards, tom lane





view thread (2+ messages)

Message-ID: <104861.1746669034@sss.pgh.pa.us>
Permalink:  ../104861.1746669034@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/104861.1746669034@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, samfelder17@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18917: "Foreign key constraint drop fails with 'column is not in index' unless pg_constraint is queried
  In-Reply-To: <104861.1746669034@sss.pgh.pa.us>

* 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