Modify ↓
Ticket #252 (closed defect: fixed)
Removing check constraint fails with uppercase constraint name in Postgres
| Reported by: | ubercore | Owned by: | andrew |
|---|---|---|---|
| Priority: | major | Milestone: | 0.6.2 |
| Component: | databaseapi | Version: | 0.6.1 |
| Keywords: | Cc: |
Description
I have a PositiveIntegerField? called ADA. The check constraint generated is called appname_model_ADA_check. When changing the column to nullable, South generates the following sql to drop the constraint:
ALTER TABLE appname_model DROP CONSTRAINT appname_model_ADA_check
This statement fails:
psycopg2.ProgrammingError: constraint "appname_model_ada_check" does not exist
This is because postgresql drops all unquoted identifiers to lowercase ( http://www.postgresql.org/docs/8.0/static/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS). The following sql, with a quoted identifier, works properly:
ALTER TABLE appname_model DROP CONSTRAINT "appname_model_ADA_check"
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

Fixed in [4c06786f7b78].