BUG #17085: Should be able to create an index without referential checking when ON DELETE NO ACTION

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: porton(at)narod(dot)ru
Subject: BUG #17085: Should be able to create an index without referential checking when ON DELETE NO ACTION
Date: 2021-07-06 21:03:37
Message-ID: 17085-26d62a05c4c37991@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 17085
Logged by: Victor Porton
Email address: porton(at)narod(dot)ru
PostgreSQL version: 13.3
Operating system: Linux
Description:

When there is either ON DELETE NO ACTION or ON UPDATE NO ACTION for a
foreign key, referential integrity is not preserved anyway.

Therefore in this case ALTER TABLE should be able to create an index
without referential checking.

It is especially useful for removing superfluous data like:

delete from tags using transactions where not exists(select * from
transactions where tags.tx_id=transactions.id);

I've got into a trouble: This command runs too long because of no foreign
key, but I can't create a foreign key because this command didn't run yet to
make referntial integrity working.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2021-07-06 23:32:07 Re: BUG #17085: Should be able to create an index without referential checking when ON DELETE NO ACTION
Previous Message Peter Eisentraut 2021-07-06 17:56:10 Re: BUG #17061: Impossible to query the fields of the tuple created by SEARCH BREADTH FIRST BY .. SET ..