M1ha-Shvn / django-pg-bulk-update

Django manager for performing bulk update operations in PostgreSQL database
BSD 3-Clause "New" or "Revised" License
39 stars 13 forks source link

SQL generation fails when the model table name is already quoted #63

Closed ryanhennig closed 3 years ago

ryanhennig commented 3 years ago

Error encountered: django.db.utils.ProgrammingError: zero-length delimited identifier at or near """"

This issue occurs when attempting to do a bulk_update_or_create with a model which already has double-quotes in the table name. This occurs if you define your model with a table_name which includes a double-quoted schema name prefix, like so:

class MyModel(models.Model): class Meta: db_table = '"schema"."mymodel"'

M1ha-Shvn commented 3 years ago

Thanks for report and PR. I'll review your PR as soon as possible

M1ha-Shvn commented 3 years ago

Released v3.4.1