diff options
author | Tom <tom@tomforb.es> | 2017-10-03 00:35:38 +0100 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2018-08-03 17:40:46 -0400 |
commit | f1fbef6cd171ddfae41fcc901f1f60ccad039f51 (patch) | |
tree | 414e5d00478371dd01e0bf69467cc32301260cb5 /django/db/backends/postgresql/operations.py | |
parent | 45086c294d63ac8787cebff2accd1680ac844138 (diff) | |
download | django-f1fbef6cd171ddfae41fcc901f1f60ccad039f51.tar.gz |
Fixed #28668 -- Allowed QuerySet.bulk_create() to ignore insert conflicts.
Diffstat (limited to 'django/db/backends/postgresql/operations.py')
-rw-r--r-- | django/db/backends/postgresql/operations.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/django/db/backends/postgresql/operations.py b/django/db/backends/postgresql/operations.py index 400f014a42..f4e9571f81 100644 --- a/django/db/backends/postgresql/operations.py +++ b/django/db/backends/postgresql/operations.py @@ -277,3 +277,6 @@ class DatabaseOperations(BaseDatabaseOperations): if extra: prefix += ' (%s)' % ', '.join('%s %s' % i for i in extra.items()) return prefix + + def ignore_conflicts_suffix_sql(self, ignore_conflicts=None): + return 'ON CONFLICT DO NOTHING' if ignore_conflicts else super().ignore_conflicts_suffix_sql(ignore_conflicts) |