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 8730527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:02:36+00:00 2026-06-13T09:02:36+00:00

My client has given me a list of vehicles for a project. I need

  • 0

My client has given me a list of vehicles for a project. I need to get them into a table I can use, but they’re currently in a .cvs file. I’ve read around and found some info, but nothing that solves my particular problem.

I’ve generated a model that matches the info in the .cvs file(id, year, make, model, trim), run the migration, and now have the table I need. The issue comes up when I try to use psql COPY. Here’s what I’ve read will work:

copy list_vehicles from '/path/to/list.csv' DELIMITERS ',' CSV;

but it gives me

ERROR:  missing data for column "created_at"

Fine, so I try this:

copy list_vehicles (id, year, make, model, trim)  from '/path/to/list.csv' DELIMITERS ',' CSV;

and I get back

ERROR:  null value in column "created_at" violates not-null constraint

Ok, so then this should work:

copy list_vehicles (id, year, make, model, trim)  from '/path/to/list.csv' DELIMITERS ',' WITH NULL AS ' ' CSV FORCE NOT NULL created_at;

nope,

ERROR:  FORCE NOT NULL column "created_at" not referenced by COPY

I’m not sure where to go from here. I was thinking of trying to take the created_at column back out for now, then add it in another migration? Any guidance would be much appreciated.

Thanks

  • 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-13T09:02:37+00:00Added an answer on June 13, 2026 at 9:02 am

    The created_at column is made automatically by Rails most of the time when you run a migration to create a table for a new model. It’s generally populated most of the time by the Rails default code when you create a new model object in your application.

    You’re loading the data directly into the database, though, bypassing all the Rails code. Which is fine, but you also need to do the things Rails does.

    I think the easiest way is going to be to remove the created_at and other columns from the database directly, loading your CSV file, and then adding the columns back in.

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

Sidebar

Related Questions

I'm building a Windows Phone application and my client has given me a list
A client has given me a spreadsheet of hundreds of domain names. My task
My client has a website but doesn't check emails often. He has a lot
We have a running project in which client has asked to implement Google DoubleClick
I have a rather hectic situation in which my client has given me a
My client has recently taken ownership of an existing web site, with final deliverable
My client has a compiled ASP.NET 2.0 application that was compiled & deployed a
A client has asked for a page loader, something attractive to let the visitor
My client has a asp.net application, using ajax, he has a datagrid that shows
A client has asked me to make their YouTube channel look similar this one:

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.