Small. Fast. Reliable.
Choose any three.

Export the data from your database as tab delimited text. Create one text file for every table in your database:

    $ pg_dump -a <dbname> -t <tablename> > /tmp/<dumpfile>
    ...and so on...

Trim off crap from header and footer from each file, eg:

    $ nano -w /tmp/<dumpfile>

If required, create SQLite file and tables corresponding to tables in the original PostgreSQL database:

    $ sqlite3 <dbname>
    sqlite> CREATE TABLE ...etc...

Finally, import the dump files into SQLite, remembering to change the default import separator to a <tab>:

    $ sqlite3 <dbname>
    sqlite> .separator "\t"
    sqlite> .import <dumpfile> <tablename>

Attachments:

  • fx2lite.prg 5579 bytes added by anonymous on 2006-Sep-21 09:03:53 UTC.
    • A DOS foxpro program to transfer .dbf into an sqlite table is here

  • MDBtoSQLite.vbs 16259 bytes added by anonymous on 2008-Jan-18 11:07:20 UTC.
    Takes in an MDB and produces a text file that can be piped into the sqlite command line tool to create a database. 2008-01-16 <lokkju@lokkju.com> Fixed INTEGER field types to handle null data, now will insert 0, used to break it by inserting nothing. Also modified to accept database path from the command line as an argument.