Re: importing db as text files - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: importing db as text files
Date
Msg-id 20030814140155.GF27870@wolff.to
Whole thread Raw
In response to Re: importing db as text files  ("Gregory S. Williamson" <gsw@globexplorer.com>)
List pgsql-general
On Thu, Aug 14, 2003 at 00:50:27 -0700,
  "Gregory S. Williamson" <gsw@globexplorer.com> 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 ?
[doesan 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,
justno 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.

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: query tuning
Next
From: Vivek Khera
Date:
Subject: Re: postgres as an snmp client