On 8 Jun 2010, at 10:47pm, Scott Frankel wrote: > On Jun 8, 2010, at 2:28 PM, Simon Slavin wrote: > >> Either write a program to read record-by-record and write record-by- >> record, or use PostgreSQL functions to write to SQL commands then >> execute those commands to create a new SQLite database. > > Before heading down the path of issuing record-by-record statements, I > thought there might be some hope with generic SQL commands or bulk > importing ... a newbie's hope ;)
SQLite includes a command-line tool which can be used to dump a database to a text file of SQL commands, or read the text-file and use it to create a new database. If PostgreSQL has an equivalent tool, you can do it all without writing a line of code. Better still, you'll have the text file which will act as an excellent backup of your data in case something goes wrong. (You may have to use a text editor to make minor changes to the format of the SQL commands.) When I backup any SQL database for long-term archive purposes I always back it up as SQL commands, never in its native file format. This means I don't have to worry about trying to find some software to read an obsolete file format. (Assuming that there will be software which can read a .zip file for the foreseeable future.) Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users