Changeset 4972
- Timestamp:
- 04/09/07 06:05:50 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/unicode/django/db/backends/postgresql/base.py
r4971 r4972 84 84 if set_tz: 85 85 cursor.execute("SET TIME ZONE %s", [settings.TIME_ZONE]) 86 if not settings.DATABASE_CHARSET: 87 cursor.execute("SHOW client_encoding") 88 encoding = ENCODING_MAP[cursor.fetchone()[0]] 89 else: 90 encoding = settings.DATABASE_CHARSET 86 cursor.execute("SHOW client_encoding") 87 encoding = ENCODING_MAP[cursor.fetchone()[0]] 91 88 cursor = UnicodeCursorWrapper(cursor, encoding) 92 89 global client_encoding … … 94 91 # We assume the client encoding isn't going to change for random 95 92 # reasons. 93 Database.register_type(Database.new_type(Database.types[1043].values, 'STRING', typecast_string)) 96 94 client_encoding = encoding 97 95 global postgres_version … … 269 267 Database.register_type(Database.new_type((1114,1184), "TIMESTAMP", util.typecast_timestamp)) 270 268 Database.register_type(Database.new_type((16,), "BOOLEAN", util.typecast_boolean)) 271 Database.register_type(Database.new_type(Database.types[1043].values, 'STRING', typecast_string))272 269 273 270 OPERATOR_MAPPING = {
