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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #18917: "Foreign key constraint drop fails with 'column is not in index' unless pg_constraint is queried
Дата
Msg-id 104861.1746669034@sss.pgh.pa.us
обсуждение исходный текст
Ответ на 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>)
Список 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 по дате отправления: