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 CEF4ED1B56B for ; Wed, 13 Aug 2003 21:24:44 +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 73754-02 for ; Wed, 13 Aug 2003 18:23:07 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id CA9A6D1C4D6 for ; Wed, 13 Aug 2003 18:24:31 -0300 (ADT) Received: (qmail 27658 invoked by uid 500); 13 Aug 2003 21:30:04 -0000 Date: Wed, 13 Aug 2003 16:30:04 -0500 From: Bruno Wolff III To: expect Cc: pgsql-general@postgresql.org Subject: Re: importing db as text files Message-ID: <20030813213004.GA27062@wolff.to> Mail-Followup-To: expect , pgsql-general@postgresql.org References: <20030813141420.1db05267.expect@ihubbell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030813141420.1db05267.expect@ihubbell.com> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/647 X-Sequence-Number: 47064 On Wed, Aug 13, 2003 at 14:14:20 -0700, expect wrote: > > What's the big deal with importing text files? I have a 70 MB file to import > and it's been one problem after another. I used the copy command and it appears > that it's just not possible. I finally massaged the file into a .sql file and That is unlikely, but without more details it is hard to say what you need to do. > ran that using \i db.sql but that failed too because I overlooked ' in names > like D'Adario. The other problem I encountered was that a numeric field had > to have data in it, pg would not default to the default value. So instead of You can use the keyword default in insert statements to get a default value. > massaging all the data again I decided to change the data type for that column. > This is my first experience with postgresql and I'm wondering if I should expect > to encounter similar pain as I go further into this? So far it's been very > painful trying to do what I thought would be easy and what I think should be > easy. The impression I get is that you expect postgres to make a best guess when presented with ambiguous data. That is a very dangerous thing to do. I would much prefer ambiguous data be rejected so that I can make sure what I think the value is, is the same as what the database thinks the value is.