| 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: | 4D5C6F5B.7010702@intel.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Rich Shepard | 2011-02-17 00:50:09 | Re: SQLite to Postgres, II |
| Previous Message | Rich Shepard | 2011-02-17 00:38:21 | SQLite to Postgres, II |