Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: column "increment_by" does not exist - Postgres 10 and Rails 5

This seems like a common error with Postgres 10 but I am not sure if its just Postgres 10 or its because I am using Rails 5 as well. I have a Rails 5 application on Digital Ocean that is getting ready to go live and as I started to implement backups, I ran into a huge issue. When I try and do backups with Navicat or directly with pg_dump, I am faced with the following error - [Err] [Bak] Get sequences: ERROR: column "increment_by" does not exist LINE 1: SELECT last_value, increment_by, max_value, min_value, cache...

I cannot figure out what to do and there is way too much information already added to the site to tear it down and start over. I am hoping someone here has found a work around, at least to allow me to perform a backup so I can recreate the database in a correct version.

like image 469
Charles Smith Avatar asked May 08 '18 20:05

Charles Smith


1 Answers

In case anyone runs into this with Rails 4.1 (4.1.16 in my case), the answer for Rails 4.2 (here: https://github.com/rails/rails/issues/28780#issuecomment-354868174) works great but I had to make one change to get it to work- I changed module PostgreSQL to class PostgreSQLAdapter.

like image 190
elements Avatar answered Oct 05 '22 23:10

elements