From: Martijn van Oosterhout <kleptog@svana.org>
To: Gregory S. Williamson <gsw@globexplorer.com>
Cc: expect <expect@ihubbell.com>
Cc: pgsql-general@postgresql.org
Subject: Re: importing db as text files
Date: Thu, 14 Aug 2003 14:24:30 +1000
Message-ID: <20030814042430.GC13887@svana.org> (raw)
In-Reply-To: <71E37EF6B7DCC1499CEA0316A2568328DC9819@loki.globexplorer.com>
References: <71E37EF6B7DCC1499CEA0316A2568328DC9819@loki.globexplorer.com>
On Wed, Aug 13, 2003 at 02:59:29PM -0700, Gregory S. Williamson wrote:
> I tend to use perl to preprocess dumps (in our case from Informix). It tends to work much faster than shell scripts (although your mileage may vary). I have to fix missing numeric values (if the column allows nulls why can't the copy command accept an empty field, I wonder?), missing dates. In other cases is massages date formats, spatial data, etc. For example, a crude program below to clean DOQQ metadata:
[snip]
> $t_production_date = "\\N"; # psql seems to dump a blank data with this nomenclature
Umm, \N represents NULL. NULL is not a blank field, it's null. You could
also tell copy that a blank field represents a null but that might have
unexpected effects on text fields which are supposed to be blank.
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/> "All that is needed for the forces of evil to triumph is for enough good
> men to do nothing." - Edmond Burke
> "The penalty good people pay for not being interested in politics is to be
> governed by people worse than themselves." - Plato
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: kleptog@svana.org, gsw@globexplorer.com, expect@ihubbell.com
Subject: Re: importing db as text files
In-Reply-To: <20030814042430.GC13887@svana.org>
References: <71E37EF6B7DCC1499CEA0316A2568328DC9819@loki.globexplorer.com> <20030814042430.GC13887@svana.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox