Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8492649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:46:50+00:00 2026-06-10T22:46:50+00:00

After finding 2 SO questions related to string vs. text fields, I discovered that

  • 0

After finding 2 SO questions related to string vs. text fields, I discovered that the link field is already text:

create_table "answers", :force => true do |t|
  t.string   "text"
  t.text     "link"

Why is Postgres throwing the following error:

ActiveRecord::StatementInvalid: PG::Error: ERROR:  value too long for type character varying(255)

I tried a migration change_column :answers, :link, :text, :limit => nil but I don’t think that does anything.

Edit: So, the problem is that the schema says the field is text, but actually it is string:

Answer.new.column_for_attribute('link').type
=> :string

What is the best way to fix it? By rebuilding the database from the schema? By changing it to string and then back to text?

Rails 3.2.2, Postgres 9, Heroku.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T22:46:52+00:00Added an answer on June 10, 2026 at 10:46 pm

    Not quite sure how it happened, but one of the following:

    1. I checked the schema after running the migration, so actually it was in sync.
    2. I ran a migration to change the type to string, bringing the schema in sync.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Silverlight Beta 4 for a LOB application. After finding out today that
I know that Cross validation is used for selecting good parameters. After finding them,
I am in a situation that I can't really resolve after reading many questions/solutions
First time user here. I am usually capable of finding answers for questions but
I originally asked this question , but in finding an answer, discovered that my
I'd basically like to use reflection in Powershell, and after dynamically finding the methods
I'm finding this kind of overriding after a new in java code very often
I am having trouble finding out why my iAd is not being removed after
I have had trouble finding help in the matlab documentation and previous questions about
After answering this question and not finding a satisfying answer in the standard paper,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.