Getting error - type "json" does not exist - in Postgresql during rake db migrate
json, postgresql, ruby, ruby-on-rails
Solution
I have tried upgrading to PostgreSQL 9.3.4, but the issue still persists
Most likely you're still connecting to the old version. Try `SELECT version()`.
Since you mention `apt-get` you're presumably on Debian or Ubuntu. These use `pg_wrapper` to allow multiple PostgreSQL installs in parallel. Each one gets a different port number. The first install gets the default port 5432. Subsequent installs get higher ports.
You can view the installs with `pg_lsclusters`. Most likely your 9.3 install is on port 9433, and you need to change your `database.yml` (since you're using Rails) to connect to that port.
Problem
I have recently cloned a project to my local Ubuntu box now that I am remote, and upon rake db migrate, I get the following error: ``` PG::UndefinedObject: ERROR: type "json" does not exist ``` A couple columns in my tables that are: ``` add_column :table, :column, :json ``` This migration works on the Macs at work, but are not working here. I have tried upgrading to PostgreSQL 9.3.4, but the issue still persists. I also tried sudo apt-get upgrade postgresql, and still the problem persists. Ruby version is 2.1.0 Rails version is 4.0.3