#30533: Delete cascade can break postgresql database: too large 'DELETE FROM a
WHERE a.b_id IN (...)'.
-------------------------------------+-------------------------------------
     Reporter:  Thomas Riccardi      |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  wontfix
     Keywords:  queryset delete      |             Triage Stage:
  cascade batch bulk_batch_size      |  Unreviewed
  postgresql crash                   |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by felixxm):

 * status:  new => closed
 * resolution:   => wontfix


Comment:

 If we don't have any restrictions in PostgreSQL I wouldn't classify this
 as a bug in Django. In SQLite and Oracle we limit the number of queries
 parameters or even the number of parameters in ` IN (...)` list, because
 we have to. These are databases limitations, which is not the case on
 PostgreSQL. You have at least two ways to handle this:
  - `delete()` in chunks (1-2M) using ORM, or
  - [https://www.postgresql.org/docs/11/sql-truncate.html TRUNCATE ...
 CASCADE] table manually .

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30533#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/073.9d0e69f750d7aa2876064a2bb4e6ae56%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to