﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
2496	select_related will cause table multiple times in FROM clause if table already in extra()	rezzrovv	nobody	"If a QuerySet is built or initialized with select_related and  extra() and extra contains a table that will ultimately be iterated over through the select_related, that table will not be picked up in fill_table_cache.  The result is a query with the table twice in the FROM clause and results in an DB error when executed (at least on postgresql, can't speak for any other DBs).  Patch submitted.  Example error from postgresql:

ProgrammingError: 'ERROR:  table name ""client"" specified more than once"	defect	closed	Database layer (models, ORM)	dev	normal	fixed	qs-rf-fixed		Accepted	1	0	1	1	0	0
