From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | "Gregory S(dot) Williamson" <gsw(at)globexplorer(dot)com> |
Cc: | expect <expect(at)ihubbell(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: importing db as text files |
Date: | 2003-08-14 04:24:30 |
Message-ID: | 20030814042430.GC13887@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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(at)svana(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Mike Mascari | 2003-08-14 04:38:39 | Re: Why the duplicate messages to pgsql-general? |
Previous Message | Bruce Momjian | 2003-08-14 04:23:34 | Re: Why the duplicate messages to pgsql-general? |