OT: database advice

Klaasjan Brand klaasjan at gmail.com
Mon Apr 25 07:11:08 UTC 2005


On 4/25/05, Duncan Lithgow <duncan at lithgow-schmidt.dk> wrote:
> On Sun, 2005-04-24 at 23:40 -0500, Bruno Wolff III wrote:
> > Actually csv (or tsv) is a reasonable way to represent the data in a
> > relational database. This won't capture information about the structure
> > of the database. This would include datatypes of the data, constraints and
> > triggers.
> I thought they give problems when the data includes commas? Is there
> some mechanism I don't understand? 

It's not that hard: on most systems there's the escape character
(usually \) which is used to define a character as a literal text
instead of a separator; if your field separator is a comma, \, would
mean a real comma. \\ would mean a real backslash.

> If I understand you correctly this
> way of taking a snapshot does not preserve structure, only data. So it
> would involve some scripting to put it back into a database. Is that
> right?

You'll also need to backup the table definitions of course.
Some databases have an import tool that's able to handle csv. The only
problem is you're going to end up with one file per table, so if you
have a lot of tables you need to import a lot of files...

Klaasjan




More information about the users mailing list