pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: porton@narod.ru
Subject: BUG #17085: Should be able to create an index without referential checking when ON DELETE NO ACTION
Date: Tue, 06 Jul 2021 21:03:37 +0000
Message-ID: <17085-26d62a05c4c37991@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      17085
Logged by:          Victor Porton
Email address:      porton@narod.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.



view thread (6+ messages)  latest in thread

Message-ID: <17085-26d62a05c4c37991@postgresql.org>
Permalink:  ../17085-26d62a05c4c37991@postgresql.org/
Also on:    postgresql.org/message-id/17085-26d62a05c4c37991@postgresql.org

 · 

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: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, porton@narod.ru
  Subject: Re: BUG #17085: Should be able to create an index without referential checking when ON DELETE NO ACTION
  In-Reply-To: <17085-26d62a05c4c37991@postgresql.org>

* 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