Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data contains null bytes which is not supported by PostgreSQL #11

Closed
jpic opened this issue Nov 3, 2011 · 1 comment
Closed

Data contains null bytes which is not supported by PostgreSQL #11

jpic opened this issue Nov 3, 2011 · 1 comment

Comments

@jpic
Copy link

jpic commented Nov 3, 2011

Loading data does not work with the new django-cities version on PostgreSQL 9.1.1 with PostGIS 1.5.3

time ./manage.py loaddata geonames_dump
Problem installing fixture '/srv/art/art_env/src/cities/cities/fixtures/geonames_dump.json': Traceback (most recent call last):
File "/srv/art/art_env/lib/python2.7/site-packages/django/core/management/commands/loaddata.py", line 174, in handle
obj.save(using=using)
File "/srv/art/art_env/lib/python2.7/site-packages/django/core/serializers/base.py", line 165, in save
models.Model.save_base(self.object, using=using, raw=True)
File "/srv/art/art_env/lib/python2.7/site-packages/django/db/models/base.py", line 553, in save_base
result = manager._insert(values, return_id=update_pk, using=using)
File "/srv/art/art_env/lib/python2.7/site-packages/django/db/models/manager.py", line 195, in _insert
return insert_query(self.model, values, **kwargs)
File "/srv/art/art_env/lib/python2.7/site-packages/django/db/models/query.py", line 1436, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
File "/srv/art/art_env/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 791, in execute_sql
cursor = super(SQLInsertCompiler, self).execute_sql(None)
File "/srv/art/art_env/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 735, in execute_sql
cursor.execute(sql, params)
File "/srv/art/art_env/lib/python2.7/site-packages/django/db/backends/util.py", line 34, in execute
return self.cursor.execute(sql, params)
File "/srv/art/art_env/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute
return self.cursor.execute(query, args)
DatabaseError: invalid byte sequence for encoding "UTF8": 0x00

./manage.py loaddata geonames_dump 13.49s user 0.59s system 85% cpu 16.390 total

Please let me know if I can provide any other information.

@jpic jpic closed this as completed Nov 3, 2011
@jpic
Copy link
Author

jpic commented Nov 3, 2011

Django bug with postgresql 9.1.1, ticket with patch: https://code.djangoproject.com/ticket/16778

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant