Re: BUG #18917: "Foreign key constraint drop fails with 'column is not in index' unless pg_constraint is queried - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #18917: "Foreign key constraint drop fails with 'column is not in index' unless pg_constraint is queried
Date
Msg-id 104861.1746669034@sss.pgh.pa.us
Whole thread Raw
In response to BUG #18917: "Foreign key constraint drop fails with 'column is not in index' unless pg_constraint is queried  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
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



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #18917: "Foreign key constraint drop fails with 'column is not in index' unless pg_constraint is queried
Next
From: PG Bug reporting form
Date:
Subject: BUG #18919: Source archives in ftp/source/v17.5 are missing