diff options
author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-06-30 00:38:14 +0000 |
---|---|---|
committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-06-30 00:38:14 +0000 |
commit | b0bc8b9dfd6069e53cd73c1d3411f995a05f0a5a (patch) | |
tree | c9c8da51923c8346ba419a929f69d85b27d0b2c5 /django/db/backends/postgresql/operations.py | |
parent | f62e5a1fba0c711706264d6b2ce2f5cd6b2c5073 (diff) | |
download | django-b0bc8b9dfd6069e53cd73c1d3411f995a05f0a5a.tar.gz |
Fixed #7565 -- Fixed a problem with PostgreSQL sequence resetting in loaddata.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7789 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/backends/postgresql/operations.py')
-rw-r--r-- | django/db/backends/postgresql/operations.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/backends/postgresql/operations.py b/django/db/backends/postgresql/operations.py index 7e27b23f72..ba6e3235c2 100644 --- a/django/db/backends/postgresql/operations.py +++ b/django/db/backends/postgresql/operations.py @@ -97,7 +97,7 @@ class DatabaseOperations(BaseDatabaseOperations): # Use `coalesce` to set the sequence for each model to the max pk value if there are records, # or 1 if there are none. Set the `is_called` property (the third argument to `setval`) to true # if there are records (as the max pk value is already in use), otherwise set it to false. - for f in model._meta.fields: + for f in model._meta.local_fields: if isinstance(f, models.AutoField): output.append("%s setval('%s', coalesce(max(%s), 1), max(%s) %s null) %s %s;" % \ (style.SQL_KEYWORD('SELECT'), |