[Novalug] Bonnie's DOS Database

Theodore Ruegsegger truegsegger@csc.com
Wed May 2 10:29:38 EDT 2007


Bonnie wrote:
> I can easily write a perl program to put them into csv format but I
> have been unable to find a tutorial for MySQL or PostreSQL that
> tells me how to import stuff into a one of these database programs
> and I am unwilling to hand reenter all the records.

I have some notes on the process:
http://www.tux.org/~tbr/database-conversion/

Granted this is for pathological cases but reading between the lines
should give you an idea how to do the conversion. Since you have a way
of doing dumps in plain text format, you're most of the way there.
Come to think of it, I'm not sure you need to read that article at
all.

In PostgreSQL, importing a delimited text file is trivial (preferably
tab-delimited but you can use any delimiter you wish as long as you
escape it when it occurs within a field). If that's the route you want
to go, I'll be happy to help. For a single table, it's just a COPY
command:

COPY mytable(column1, column2, ...) FROM stdin;
[tab-delimited records go here]
\.

I imagine MySQL has a similarly straightforward import mechanism.

Ted




More information about the Novalug mailing list