﻿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
1034	Object save fails for models with mixed-case names using postgresql	rfugger at gmail dot com	Adrian Holovaty	"Using a model named 'myApp.py', the 0.90 build fails the first time I try to save an object to the database (postgresql) with this message:
{{{
ProgrammingError at /admin/myApp/units/add/
ERROR: relation ""myapp_units_id_seq"" does not exist SELECT CURRVAL('myApp_units_id_seq')
}}}

The faulty code seems to be in django\core\db\backends\postgresql.py around line 69:
{{{
cursor.execute(""SELECT CURRVAL('%s_%s_seq')"" % (table_name, pk_name))
}}}

The proper SQL statement to handle the mixed-case name should be (note the double quotes):
{{{
SELECT CURRVAL('""myApp_units_id_seq""')
}}}

So this code would probably work (haven't tried):
{{{
cursor.execute(""SELECT CURRVAL('\""%s_%s_seq\""')"" % (table_name, pk_name))
}}}

Renaming myApp to myapp fixed the problem.  This problem didn't occur with previous builds.  Other lines of code might have the same missing double quotes."	defect	closed	Database layer (models, ORM)		normal	fixed			Unreviewed	0	0	0	0	0	0
