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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:55:05+00:00 2026-05-30T23:55:05+00:00

I started a project with Rails without knowing Heroku required Postgresql. Now I would

  • 0

I started a project with Rails without knowing Heroku required Postgresql. Now I would like to convert my sqlite3 table to a postgresql table. How can I do it?

I found a way to get SQL Inserts :

BEGIN TRANSACTION;
insert into places ("id", "name", "content", "tags", "created_at", "updated_at") values ('0', 'bac à papier', NULL, 'bac de recyclage', '13309980782012-03-06 03:57:21.219233', '13309980782012-03-06 03:57:21.219233');
insert into places ("id", "name", "content", "tags", "created_at", "updated_at") values ('1', 'bac PVM', 'plastique/verre/métal', NULL, '13310076572012-03-06 03:57:21.219233', '13310076572012-03-06 03:57:21.219233');
insert into places ("id", "name", "content", "tags", "created_at", "updated_at") values ('2', 'bac de déchets', NULL, 'poubelle', '13310076572012-03-06 03:57:21.219233', '13310076572012-03-06 03:57:21.219233');
insert into places ("id", "name", "content", "tags", "created_at", "updated_at") values ('3', 'cafétéria', '', '', '2012-03-06 03:57:21.219233', '2012-03-06 03:57:21.219233');
insert into places ("id", "name", "content", "tags", "created_at", "updated_at") values ('4', 'compost', NULL, NULL, '2012-03-06 03:57:21.219233', '2012-03-06 03:57:21.219233');
insert into places ("id", "name", "content", "tags", "created_at", "updated_at") values ('5', 'consigne', NULL, NULL, '2012-03-06 03:57:21.219233', '2012-03-06 03:57:21.219233');
insert into places ("id", "name", "content", "tags", "created_at", "updated_at") values ('6', 'CRD', NULL, NULL, '2012-03-06 03:57:21.219233', '2012-03-06 03:57:21.219233');
insert into places ("id", "name", "content", "tags", "created_at", "updated_at") values ('7', 'ressources matérielles', NULL, NULL, '2012-03-06 03:57:21.219233', '2012-03-06 03:57:21.219233');
insert into places ("id", "name", "content", "tags", "created_at", "updated_at") values ('8', 'sécurité', NULL, NULL, '2012-03-06 03:57:21.219233', '2012-03-06 03:57:21.219233');
insert into places ("id", "name", "content", "tags", "created_at", "updated_at") values ('10', 'technicien chimie', NULL, NULL, '2012-03-06 03:57:21.219233', '2012-03-06 03:57:21.219233');
insert into places ("id", "name", "content", "tags", "created_at", "updated_at") values ('11', 'technicien biologie', NULL, NULL, '2012-03-06 03:57:21.219233', '2012-03-06 03:57:21.219233');
insert into places ("id", "name", "content", "tags", "created_at", "updated_at") values ('12', 'service informatique', NULL, NULL, '2012-03-06 03:57:21.219233', '2012-03-06 03:57:21.219233');
insert into places ("id", "name", "content", "tags", "created_at", "updated_at") values ('13', 'îlot multi-récupération', 'face au B-227', NULL, '2012-03-06 03:57:21.219233', '2012-03-06 03:57:21.219233');
insert into places ("id", "name", "content", "tags", "created_at", "updated_at") values ('14', 'récupérateurs extérieurs', NULL, NULL, '2012-03-06 03:57:21.219233', '2012-03-06 03:57:21.219233');
COMMIT;

SOLUTION
Here is how I solved the problem :

I used Chris’s solution to tell rails that I want to use PostgreSQL. Then, I ran db:migrate.

To convert my SQLite tables to PostgreSQL tables, I used sliteman, a Linux program to manage SQLite databases. With this utility, I was able to convert the tables to SQL inserts. I logged in to PostgreSQL and applied the inserts.

Voila!

  • 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-30T23:55:07+00:00Added an answer on May 30, 2026 at 11:55 pm

    If you just want your local db to run on postgres to match heroku, just change your database.yml to look something like this:

    development:
      adapter: postgresql
      encoding: utf8
      database: development
      pool: 5
      username: postgres
      password:
    
    test: &TEST
      adapter: postgresql
      encoding: utf8
      database: test
      pool: 5
      username: postgres
      password:
    
    production:
      adapter: postgresql
      encoding: utf8
      database: production
      pool: 5
      username: postgres
      password:
    
    cucumber:
      <<: *TEST
    

    This is under the assumption you have a postgres role with the name ‘postgres’. If you are on a mac, your username should by default be whatever your user shortname is.

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

Sidebar

Related Questions

I started a Rails project recently and decided to use RESTful controllers. I created
So I just started my first rails project yesterday. I had two many-to-many (has_and_belongs_to_many)
I have recently started a project in Ruby on Rails. I used to do
I just started using CakePHP for a small project. I have rails experience, and
How can I start using Rspec with an existing Ruby on Rails 2.3.5 project
I'm trying to get a Ruby on Rails project started on Dreamhost, ruby version
I started a new project in rails and setup a server and assembla to
I'm new to Rails and have started a project that I'm unhappy with my
I just started using the new project type SQL Server 2008 Database. I can
Working on a [rails] project, I've started playing around with RSS parsing. I notice

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.