Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#18258 closed Bug (wontfix)

Too aggressive statements spliting in custom sql

Reported by: scibi Owned by: nobody
Component: Core (Management commands) Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently django.core.management.sql.custom_sql_for_model splits statements using r";[ \t]*$"

Unfortunately it doesn't work for statements which include ; like PL/PgSQL functions.

Change History (3)

comment:1 Changed 4 years ago by scibi

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Summary: To aggressive statements spliting in custom sqlToo aggressive statements spliting in custom sql

comment:2 Changed 4 years ago by Anssi Kääriäinen

Resolution: wontfix
Status: newclosed

We need a better way to run custom SQL. I don't believe there is any way to split the SQL correctly, apart of having full parsers for each of the different backends.

For example reliable pre_model_created, post_model_created signals could be useful here. post_syncdb is also issued after flush which makes it unusable.

I am going to mark this wontfix as there isn't much we can do about it.

comment:3 Changed 4 years ago by Claude Paroz

I'd still like to commit #4680, but I also admit that it is probably the most we can do without resorting to a full parser.

Note: See TracTickets for help on using tickets.
Back to Top