@@ -167,7 +167,7 @@ def get_relations(self, cursor, table_name):
167
167
rc.UNIQUE_CONSTRAINT_NAME = ccu.CONSTRAINT_NAME
168
168
WHERE
169
169
tc.TABLE_SCHEMA=@schema_name AND tc.TABLE_NAME=@view_name
170
- """ , params = {"schema_name" : schema_name , "view_name" : self . connection . ops . quote_name ( table_name ) }
170
+ """ , params = {"schema_name" : schema_name , "view_name" : table_name }
171
171
)
172
172
return {
173
173
column : (referred_column , referred_table )
@@ -199,7 +199,7 @@ def get_primary_key_column(self, cursor, table_name):
199
199
ccu ON tc.CONSTRAINT_NAME = ccu.CONSTRAINT_NAME
200
200
WHERE
201
201
tc.TABLE_NAME=@table_name AND tc.CONSTRAINT_TYPE='PRIMARY KEY' AND tc.TABLE_SCHEMA=@schema_name
202
- """ , params = {"schema_name" : schema_name , "table_name" : self . connection . ops . quote_name ( table_name ) }
202
+ """ , params = {"schema_name" : schema_name , "table_name" : table_name }
203
203
)
204
204
return results [0 ][0 ] if results else None
205
205
@@ -216,7 +216,6 @@ def get_constraints(self, cursor, table_name):
216
216
:returns: A dictionary with constraints.
217
217
"""
218
218
constraints = {}
219
- quoted_table_name = self .connection .ops .quote_name (table_name )
220
219
schema_name = self ._get_schema_name (cursor )
221
220
222
221
# Firstly populate all available constraints and their columns.
@@ -227,7 +226,7 @@ def get_constraints(self, cursor, table_name):
227
226
FROM
228
227
INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE
229
228
WHERE TABLE_NAME=@table AND TABLE_SCHEMA=@schema_name''' ,
230
- params = {"table" : quoted_table_name , "schema_name" : schema_name }
229
+ params = {"table" : table_name , "schema_name" : schema_name }
231
230
)
232
231
for constraint , column_name in constraint_columns :
233
232
if constraint not in constraints :
@@ -357,7 +356,7 @@ def get_key_columns(self, cursor, table_name):
357
356
rc.CONSTRAINT_NAME = ccu.CONSTRAINT_NAME
358
357
WHERE
359
358
tc.TABLE_NAME=@table AND tc.TABLE_SCHEMA=@schema_name
360
- """ , params = {"table" : self . connection . ops . quote_name ( table_name ) , "schema_name" : schema_name }
359
+ """ , params = {"table" : table_name , "schema_name" : schema_name }
361
360
)
362
361
key_columns .extend (cursor .fetchall ())
363
362
return key_columns
0 commit comments