Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 1102  / 2 Years ago, thu, august 18, 2022, 6:19:26

I am building up a rails application that I cloned from my friend. I am using Ubuntu 13.10, rails 3.2.14. I am using a postgresql database and when I try to run rake db:migrate it gives me some error like this:



PG::UndefinedObject: ERROR: type "json" does not exist
LINE 1: ALTER TABLE "filters" ADD COLUMN "search_string" json



I installed pg version :- 9.3.1



running rails db output is :-psql (9.3.1, server 9.1.10)



running select version(); :-PostgreSQL 9.1.10 on i686-pc-linux-gnu



Why is it showing psql -version different from the version connected to my database??



My friend is working on 9.2.4 I don't know why this error is occurring, I tried several times to downgrade using purge or remove commands to remove 9.3.1 all goes well but when I check psql --version it again shows me 9.3.1 . Any solution ???


More From » 13.04

 Answers
1

Because you probably have different client and server version packages installed. First, I'd check what packages you have installed:



dpkg -l | grep postgresql


Then install the 9.3 server package if you don't already have it.



If you already have it, check what clusters you have running:



pg_lsclusters


If you don't already have a 9.3 cluster, make one (pg_createcluster). If you do, note the port number and make sure you connect to that one.


[#28542] Saturday, August 20, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ntlesslving

Total Points: 123
Total Questions: 109
Total Answers: 113

Location: South Korea
Member since Fri, Sep 11, 2020
4 Years ago
;