X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id E6612D1B56B for ; Thu, 14 Aug 2003 04:24:50 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 65147-05 for ; Thu, 14 Aug 2003 01:23:12 -0300 (ADT) Received: from svana.org (svana.org [203.20.62.76]) by svr1.postgresql.org (Postfix) with ESMTP id C5AF2D1B4F0 for ; Thu, 14 Aug 2003 01:24:39 -0300 (ADT) Received: from kleptog by svana.org with local (Exim 3.35 #1 (Debian)) id 19n9f4-0007JO-00; Thu, 14 Aug 2003 14:24:30 +1000 Date: Thu, 14 Aug 2003 14:24:30 +1000 From: Martijn van Oosterhout To: "Gregory S. Williamson" Cc: expect , pgsql-general@postgresql.org Subject: Re: importing db as text files Message-ID: <20030814042430.GC13887@svana.org> Reply-To: Martijn van Oosterhout Mail-Followup-To: "Gregory S. Williamson" , expect , pgsql-general@postgresql.org References: <71E37EF6B7DCC1499CEA0316A2568328DC9819@loki.globexplorer.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qjNfmADvan18RZcF" Content-Disposition: inline In-Reply-To: <71E37EF6B7DCC1499CEA0316A2568328DC9819@loki.globexplorer.com> User-Agent: Mutt/1.3.28i X-PGP-Key-ID: Length=1024; ID=0x0DC67BE6 X-PGP-Key-Fingerprint: 295F A899 A81A 156D B522 48A7 6394 F08A 0DC6 7BE6 X-PGP-Key-URL: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/669 X-Sequence-Number: 47085 --qjNfmADvan18RZcF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 te= nds 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 oth= er cases is massages date formats, spatial data, etc. For example, a crude = program below to clean DOQQ metadata: [snip] > $t_production_date =3D "\\N"; # psql seems to dump a blan= k 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. --=20 Martijn van Oosterhout 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 --qjNfmADvan18RZcF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE/Ow7+Y5Twig3Ge+YRAu2GAJ9DzO0l6+clmCk2tlTjCX9v5HIC/gCfVypp moQB0CI+2gC9IBl4L/GCgW4= =k3v2 -----END PGP SIGNATURE----- --qjNfmADvan18RZcF--