Skip to content

Instantly share code, notes, and snippets.

@Joseworks
Forked from otobrglez/casting_types.rb
Created May 11, 2017 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Joseworks/3252157621fa83266776ed4a0c8bc648 to your computer and use it in GitHub Desktop.
Save Joseworks/3252157621fa83266776ed4a0c8bc648 to your computer and use it in GitHub Desktop.
unknown OID 705: failed to recognize type of '<field>'. It will be treated as String.
#!/usr/bin/env ruby
# If you get "unknown OID 705: failed to recognize type of '<field>'. It will be treated as String."
# it probably means that type of column could not be identified when retriving records
# Example
User.where("'something' as something")
# Will results in unknown OID. However doing this:
User.where("'something'::text as something")
# Will just work. Casting is important, dude!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment