Ask Your Question
0

DatabaseError while searching for people

asked 2013-09-23 10:04:02 -0500

Kirill gravatar image

For instance I want to execute a search query by name:

example.com/users/by-group/2/everyone/?search=&t=user&query=john

It throws this error:

Traceback (most recent call last):

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/core/handlers/base.py", line 111, in get_response response = callback(request, callback_args, *callback_kwargs)

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/askbot/views/users.py", line 159, in show_users users_page = objects_list.page(page)

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/core/paginator.py", line 37, in page number = self.validate_number(number)

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/core/paginator.py", line 28, in validate_number if number > self.num_pages:

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/core/paginator.py", line 60, in _get_num_pages if self.count == 0 and not self.allow_empty_first_page:

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/core/paginator.py", line 48, in _get_count self._count = self.object_list.count()

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/db/models/query.py", line 351, in count return self.query.get_count(using=self.db)

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/db/models/sql/query.py", line 418, in get_count number = obj.get_aggregation(using=using)[None]

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/db/models/sql/query.py", line 384, in get_aggregation result = query.get_compiler(using).execute_sql(SINGLE)

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 818, in execute_sql cursor.execute(sql, params)

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute return self.cursor.execute(query, args)

DatabaseError: column "language_code" does not exist LINE 1: ...text_search_vector @@ plainto_tsquery('john') AND language_c... ^ Why this column is missing and how it can be properly restored?

Thank you.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-09-23 11:03:53 -0500

Hi

This is solved with the following command:

python manage.py init_postgresql_full_text_search

Please note that this command was updated recently due to a bug, so please update your code before executing.

edit flag offensive delete link more

Comments

Thank you! Could you share the recipe of Askbot updating in production environment?

Kirill gravatar imageKirill ( 2013-09-23 11:06:31 -0500 )edit

@Kirill, update the Askbot version, there are a number of issues fixed and some new features. Make a staging environment to test-updated and then apply the real update, there is always some risk in updating on the live server.

Evgeny gravatar imageEvgeny ( 2013-09-23 11:26:12 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-09-23 10:04:02 -0500

Seen: 61 times

Last updated: Sep 23 '13