Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recieve message: 'invalid input syntax for type inet' #19

Open
astery opened this issue May 8, 2015 · 1 comment
Open

Recieve message: 'invalid input syntax for type inet' #19

astery opened this issue May 8, 2015 · 1 comment

Comments

@astery
Copy link

astery commented May 8, 2015

I have devise based users table with couple inet fields.

  create_table "users", force: :cascade do |t|
    ...
    t.datetime "last_sign_in_at"
    t.inet     "current_sign_in_ip"
    t.inet     "last_sign_in_ip"
    t.string   "confirmation_token"
    ...
  end

Then I try to restore database I recieve error:

ActiveRecord::StatementInvalid: PG::InvalidTextRepresentation: ERROR:  invalid input syntax for type inet: "--- !ruby/object:IPAddr
family: 2
addr: 1539998154
mask_addr: 4294967295
"

Environment: rails 4.2.0, ruby 2.0.0p598, dump 1.1.0, PostgreSQL 9.3.6

@toy
Copy link
Owner

toy commented May 12, 2015

Interesting one. It seems that some conversion is missing: either it should not be dumped as IPAddr object or should be converted before trying to restore it. I'm short on time, so PR is very welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants