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

  • Home
  • SEARCH
  • 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 6820347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:24:50+00:00 2026-05-26T21:24:50+00:00

My googlefu must be weak because I cannot find anything to tell me the

  • 0

My googlefu must be weak because I cannot find anything to tell me the default limit of a string column in my Rails app (hosted at Heroku, using PostgreSQL as the database).

Any help would be appreciated!

  • 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-05-26T21:24:51+00:00Added an answer on May 26, 2026 at 9:24 pm

    ActiveRecord uses varchar(255) (or character varying (255) to be pedantic) if you don’t specify a specific limit. You can always hop into PostgreSQL with psql and say \d your_table to get the table as PostgreSQL sees it.

    I don’t think the default is specified anywhere but it is right here in the source:

    NATIVE_DATABASE_TYPES = {
      :primary_key => "serial primary key",
      :string      => { :name => "character varying", :limit => 255 },
      #...
    

    The closest thing to a specification is in the Migrations Guide:

    These will be mapped onto an appropriate underlying database type, for example with MySQL :string is mapped to VARCHAR(255).

    But that’s not about PostgreSQL and not exactly a guarantee.


    As an aside, if you’re using PostgreSQL, you should almost always go straight to :text and pretend that :string doesn’t exist. PostgreSQL treats them the same internally except that it has to do a length check on varchar. There’s a bit more discussion on this over here in another one of my answers: Changing a column type to longer strings in rails.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My googlefu is lacking tonight and I can't find an answer to this. Will
I tried to find this on the web, but my GoogleFu has failed me...
I would honestly be surprised if anything like this exists, but I couldn't find
My Google-Fu is weak today, hopefully this is a simple thing. I need to
My Google-fu is weak and so I turn to the hive mind... I have
i googled for an hour now but maybe my Google-Fu is just too weak,
I should probably be able to find an answer to this but my Google-fu
This is probably something simple I'm overlooking but my google-fu isn't turning anything up
I've been searching for this for a while, and either my google-fu is weak
My googlefu has failed me and I come to you for help: Is VBA

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.