First time here? Check out the FAQ!

DatabaseError while searching for people

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.

Kirill's avatar
asked 2013-09-23 10:04:02 -0500
edit flag offensive 0 remove flag close merge delete


add a comment see more comments

1 Answer



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.

Fitoria's avatar
answered 2013-09-23 11:03:53 -0500
edit flag offensive 0 remove flag delete link


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

Kirill's avatar Kirill (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's avatar Evgeny (2013-09-23 11:26:12 -0500) edit
add a comment see more comments