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