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

1

7

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.

Conlin answered 8/5, 2018 at 20:53 Comment(5)
Can you show the code where you are using increment_by ?Zabaglione
Who exactly is complaining about that column? pg_dump? pg_restore? Something in Rails? There were some changes in the sequence internals between PostgreSQL 9 and 10, AFAIK all the affected things in Rails have fixes out now.Leadin
@Zabaglione I'm not using increment_byConlin
@muistooshort pg_dump is complaining when I try and dump the DB. I even fired up a new Rails app with Postgres 10 and tried to dump the DB and same error happened. When I reverted back to 9.6, it worked.Conlin
Are you running pg_dump yourself? Is the pg_dump you're using from PostgreSQL 9 or 10? What version of Rails5 are you using?Leadin
N
8

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.

Nealah answered 23/5, 2019 at 21:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.