1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[2.2.x] Fixed #30258 -- Adjusted postgres schema value quoting of ranges.

Thanks Tilman Koschnick for the report and patch.

Backport of 386d89ab55 from master
This commit is contained in:
Simon Charette
2019-03-16 13:48:59 -04:00
committed by Mariusz Felisiak
parent 2a92e2e3c1
commit 883d87074d
2 changed files with 37 additions and 1 deletions

View File

@@ -22,7 +22,8 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_delete_procedure = 'DROP FUNCTION %(procedure)s(%(param_types)s)'
def quote_value(self, value):
return psycopg2.extensions.adapt(value)
# getquoted() returns a quoted byte string of the adapted value.
return psycopg2.extensions.adapt(value).getquoted().decode()
def _field_indexes_sql(self, model, field):
output = super()._field_indexes_sql(model, field)