django-pg-upsert
django-pg-upsert copied to clipboard
Escape column names in IgnoreConflictSuffix._action_sql property
We have a table with a order
column. When i try to use this field in a update=['order']
i got an error:
'syntax error at or near "order"
LINE 1: ..."network_id") DO UPDATE SET data = EXCLUDED.data, order = EX...
^
Need to wrap column names in a DO UPDATE SET
clause with a "
double quotes (like a _conflict_sql
).
Or mention in documentation that caller need to put double quotes around the fieldname: update=['"order"']
HI, thanks for your report.
Will be good if you could take care about this issue (PR welcome). If no, I will take a look when I have free time for it.