Opened 3 years ago

Closed 3 years ago

#33539 closed Cleanup/optimization (fixed)

Missing space in SQL generated by PostgresIndex

Reported by: Anders Kaseorg Owned by: Anders Kaseorg
Component: contrib.postgres Version: 3.2
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Anders Kaseorg)

If I define an index like

GinIndex("search_tsvector", fastupdate=False, name="zerver_message_search_tsvector")

the following output is generated by manage.py sqlmigrate:

CREATE INDEX "zerver_message_search_tsvector" ON "zerver_message" USING gin ("search_tsvector")WITH (fastupdate = off) ;

Note the missing space before WITH. It happens that it doesn’t affect the behavior since it follows ) (at least in all currently supported syntaxes), but it should be cleaned up anyway, so I submitted https://github.com/django/django/pull/15459.

Change History (6)

comment:1 by Anders Kaseorg, 3 years ago

Description: modified (diff)

comment:2 by Mohamed Nabil Rady, 3 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Mariusz Felisiak, 3 years ago

Owner: set to Anders Kaseorg
Status: newassigned
Type: BugCleanup/optimization

comment:4 by Mariusz Felisiak, 3 years ago

Needs tests: set

comment:5 by Mariusz Felisiak, 3 years ago

Needs tests: unset
Triage Stage: AcceptedReady for checkin

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

Resolution: fixed
Status: assignedclosed

In 7f4fc5c:

Fixed #33539 -- Fixed spaces in WITH SQL for indexes on PostgreSQL.

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