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

Length of JSON field restricted in postgresql #5

Open
ksnabb opened this issue Oct 4, 2011 · 1 comment
Open

Length of JSON field restricted in postgresql #5

ksnabb opened this issue Oct 4, 2011 · 1 comment
Milestone

Comments

@ksnabb
Copy link
Member

ksnabb commented Oct 4, 2011

The JSON field length is restricted and gives the following error when long json strings are posted to the server:

Traceback (most recent call last):

File "/usr/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/core/handlers/base.py", line 111, in get_response
response = callback(request, _callback_args, *_callback_kwargs)

File "/usr/lib/python2.6/site-packages/user_profile-1.0.0-py2.6.egg/user_profile/views.py", line 151, in profile
current_profile.update(json.dumps(values))

File "/usr/lib/python2.6/site-packages/user_profile-1.0.0-py2.6.egg/user_profile/models.py", line 55, in update
new_profile.save()

File "/usr/lib/python2.6/site-packages/user_profile-1.0.0-py2.6.egg/user_profile/models.py", line 39, in save
super(Profile, self).save(_args, *_kwargs)

File "/usr/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/db/models/base.py", line 460, in save
self.save_base(using=using, force_insert=force_insert, force_update=force_update)

File "/usr/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/db/models/base.py", line 553, in save_base
result = manager._insert(values, return_id=update_pk, using=using)

File "/usr/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/db/models/manager.py", line 195, in _insert
return insert_query(self.model, values, **kwargs)

File "/usr/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/db/models/query.py", line 1436, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)

File "/usr/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/db/models/sql/compiler.py", line 791, in execute_sql
cursor = super(SQLInsertCompiler, self).execute_sql(None)

File "/usr/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/db/models/sql/compiler.py", line 735, in execute_sql
cursor.execute(sql, params)

File "/usr/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute
return self.cursor.execute(query, args)

DatabaseError: index row size 3624 exceeds maximum 2712 for index "user_profile_profile_expire_time_key"
HINT: Values larger than 1/3 of a buffer page cannot be indexed.
Consider a function index of an MD5 hash of the value, or use full text indexing.

@ksnabb
Copy link
Member Author

ksnabb commented Nov 15, 2011

The length of the text field is limited in mongodb to 16MB and in postgresql 8160 characters. Something should be done to support more information but it probably requires an architectural change,

one way would be to save most often used data as a field, e.g. birth year or some of the opensocial person objects fields

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