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 333FAD1F5EA for ; Thu, 14 Aug 2003 13:59:05 +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 21373-07 for ; Thu, 14 Aug 2003 10:57:29 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id F3185D1F49D for ; Thu, 14 Aug 2003 10:56:18 -0300 (ADT) Received: (qmail 31055 invoked by uid 500); 14 Aug 2003 14:01:55 -0000 Date: Thu, 14 Aug 2003 09:01:55 -0500 From: Bruno Wolff III To: "Gregory S. Williamson" Cc: pgsql-general@postgresql.org Subject: Re: importing db as text files Message-ID: <20030814140155.GF27870@wolff.to> Mail-Followup-To: "Gregory S. Williamson" , pgsql-general@postgresql.org References: <71E37EF6B7DCC1499CEA0316A256832801057063@loki.globexplorer.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <71E37EF6B7DCC1499CEA0316A256832801057063@loki.globexplorer.com> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/687 X-Sequence-Number: 47104 On Thu, Aug 14, 2003 at 00:50:27 -0700, "Gregory S. Williamson" wrote: > > Two issues raised (other than my atrocious coding) > > a) if defaults for a column are defined and copy is given a value of <> (implicit NULL) why not use the default ? [does an explicit \n work -- didn't try, I have to confess] Because empty strings are valid data and you can't go assuming they are null, since you would then need a different string to represent the empty string. > b) more generally, if copy finds a column that allows null and the data is a null (not explicitly defined as such, just no data) isn't that value valid, e.g. a NULL value ? It might be bad data. The copy statement provides a way to define a string that represents the null string. It would probably be reasonable to add a way to specify a string to be replaced by the default value.