Skip site navigation (1) Skip section navigation (2)

Re: SQLite to Postgres, II

From: Michael Ewan <michael(dot)ewan(at)intel(dot)com>
To: pdxpug(at)postgresql(dot)org
Subject: Re: SQLite to Postgres, II
Date: 2011-02-17 00:44:11
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pdxpug

On 02/16/2011 04:38 PM, Rich Shepard wrote:
>     I split the .sql output file from sqlite into 5,000 line chunks and I'm
> cleaning those so they are in postgres format (no quotes, colon as
> delimiter). I have about 30K lines ready for insertion. The database has a
> name (via 'createdb'), and the top of the text file has the create table
> statement followed by 30K INSERT INTO lines.
>     Neither \copy from within psql nor pg_restore are happy with the source
> file. How do I insert these data into the named table/relation in the
> currently empty database? I don't see anything in Douglas&  Douglas.

Since it already has all the INSERT statements, you only need to run it 
as an input file:

psql -U username -d database -f foo.sql

In response to


pdxpug by date

Next:From: Rich ShepardDate: 2011-02-17 00:50:09
Subject: Re: SQLite to Postgres, II
Previous:From: Rich ShepardDate: 2011-02-17 00:38:21
Subject: SQLite to Postgres, II

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group