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 B9672D1F763 for ; Thu, 14 Aug 2003 16:35:41 +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 78899-04 for ; Thu, 14 Aug 2003 13:35:31 -0300 (ADT) Received: from ohio.stageserver.net (ohio.stageserver.net [216.180.225.74]) by svr1.postgresql.org (Postfix) with ESMTP id B3BF2D1F73E for ; Thu, 14 Aug 2003 13:08:31 -0300 (ADT) Received: from ip68-6-45-108.sb.sd.cox.net ([68.6.45.108] helo=localhost.localdomain) by ohio.stageserver.net with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.20) id 19nKe7-0004IQ-Nc for pgsql-general@postgresql.org; Thu, 14 Aug 2003 11:08:15 -0500 Date: Thu, 14 Aug 2003 09:08:16 -0700 From: expect To: pgsql-general@postgresql.org Subject: Re: importing db as text files Message-Id: <20030814090816.35ebe809.expect@ihubbell.com> In-Reply-To: <20030814134520.GC27870@wolff.to> References: <20030813141420.1db05267.expect@ihubbell.com> <20030813213004.GA27062@wolff.to> <20030813204555.755edd6b.expect@ihubbell.com> <20030814134520.GC27870@wolff.to> Organization: iHubbell X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ohio.stageserver.net X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - ihubbell.com X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/694 X-Sequence-Number: 47111 On Thu, 14 Aug 2003 08:45:20 -0500 Bruno Wolff III wrote: > On Wed, Aug 13, 2003 at 20:45:55 -0700, > expect wrote: > > On Wed, 13 Aug 2003 16:30:04 -0500 > > Bruno Wolff III wrote: > > > > > 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. > > > > > > What's unlikely? That it didn't work? But it didn't work. > > That it isn't possible to load your data using the copy command. > You may need to do some transformation before sending it to copy. > Using copy is probably going to give you the fastest load time. > > > From what I've read it should use the default value when there is no value. > > Is that not true? Is this a known issue? > > Where did you read that? What do you mean by 'no value'? The data is really very simple. Here's a pseudo-example of 2 rows of data: 191922C,Bob Cobb,D'Obbalina Sr.,312 Elm Street,Yountville,CA,94599,5,062001,082009 339111C,Elma Thelma,Velma,98 Oak Lane,St. Louis,MO,63119-2065,,, > > The syntax for the insert command is given in the manual: > INSERT INTO table [ ( column [, ...] ) ] > { DEFAULT VALUES | VALUES ( { expression | DEFAULT } [, ...] ) | query } > > > > > No you've come to the wrong impression. I believe that the problem lies in the > > fact that pg will not default to the default value when no value is present. > > And how do you think 'no value' is represented? If you use default to > respresent 'no value' then things will work as you expect for insert > statements. When you are using copy, defaults can't be used on a row > by row basis (but unlisted columns will get default values) and you will > need to inlcude the value that you want in each row. > >