﻿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
29886	PostgreSQL's unaccent lookup doesn't work if standard_conforming_strings is off	Tom McClure	Jayantha Gumballi	"So, it turns out the postgres db server setting:

set standard_conforming_strings=off/on

affects whether backslashes are interpreted as escape characters in quoted strings.

To avoid being affected by this, SQL strings that contain backslashes should use ""escape string"" syntax (ie, prefix the quoted string with E a la E'some string') for 100% unambiguous interpretation.

Tried to use unaccent today and it only worked on a postgres db when the ""standard_conforming_strings"" setting was one way.  Murphy's law, our prod db was set the other way.

Tracked the problem back to here, a bit of SQL that is not using E'string':
https://github.com/django/django/blob/master/django/db/backends/postgresql/base.py#L124

patch included"	Bug	closed	Database layer (models, ORM)	2.1	Normal	fixed		Herbert Fortes	Ready for checkin	1	0	0	0	1	0
