First time here? Check out the FAQ!
1

How to fix search when switching from MySQL to Postgresql?

Hi, I ran the SQL script for the search on Postgres, but I still get errors about missing columns on some table.

column askbot_thread.text_search_vector does not exist
LINE 1: ...estion'  AND "askbot_post"."deleted" = false  AND askbot_thr...

I read somewhere here that you guys run Postgres 8.4, but that's pretty old. Can you please figure out why it doesn't work on 9.1+?

Thanks!

siovene's avatar
431
siovene
asked 2013-03-08 11:32:41 -0500
Evgeny's avatar
13.2k
Evgeny
updated 2013-03-12 08:33:26 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

1

I did this and it fixed it:

python manage.py init_postgresql_full_text_search

I read about it here.

siovene's avatar
431
siovene
answered 2013-03-08 12:19:23 -0500
edit flag offensive 0 remove flag delete link

Comments

Which version did you upgrade to? It is very hard to answer a question about upgrade or deployment without the information on the version. This command will rerun the search setup script but will not run any migrations. I don't believe there is a bug in the development version as I run it on postgres 9.1 on several sites.

Evgeny's avatar Evgeny (2013-03-08 13:38:41 -0500) edit

I didn't upgrade to a version. I was running on .43 and switched from MySQL to PostgreSQL. The command above (in this answer) fixed my problem.

siovene's avatar siovene (2013-03-12 03:49:45 -0500) edit
add a comment see more comments
0

Possibly migrations failed. The search works for me on postgres 9.1.

You might want to increase the statement timeout setting on your postgres at least temporarily.

Evgeny's avatar
13.2k
Evgeny
answered 2013-03-08 11:34:05 -0500
edit flag offensive 0 remove flag delete link

Comments

I've update the question with the error. All my migrations seem in order. What can I do to fix this?

siovene's avatar siovene (2013-03-08 11:36:08 -0500) edit

What was your migration number prior to the upgrade?

Evgeny's avatar Evgeny (2013-03-08 11:39:55 -0500) edit

Try running this postgres script manually and please post any errors that you see: askbot/search/postgresql/thread_and_post_models_01022013.plsql

Evgeny's avatar Evgeny (2013-03-08 11:43:37 -0500) edit

These are my south migrations: http://dpaste.com/1016301/ And this is the output of that sql: http://dpaste.com/1016302/

siovene's avatar siovene (2013-03-08 11:49:23 -0500) edit

If you have askbot from the trunk we have 164 migrations. What do you get with: python manage.py migrate --list ?

Evgeny's avatar Evgeny (2013-03-08 13:12:08 -0500) edit
add a comment see more comments