Ask Your Question

DatabaseError while searching for people

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

Kirill's avatar

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

It throws this error:

Traceback (most recent call last):

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/core/handlers/", 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/", line 159, in show_users users_page =

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

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

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/core/", 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/", 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/", 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/", 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/", 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/", 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/", 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

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


This is solved with the following command:

python 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


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

Kirill's avatar Kirill  ( 2013-09-23 11:06:31 -0600 )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's avatar Evgeny  ( 2013-09-23 11:26:12 -0600 )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


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

Seen: 193 times

Last updated: Sep 23 '13