Bruno Wolff III said:
> On Mon, Apr 12, 2004 at 02:26:14 -0400,
>  Andrew Dunstan <[EMAIL PROTECTED]> wrote:
>> a few points:
>> . in CSV mode, NULL should default to '' - that was in what I sent in.
> Postgres normally treats an empty string as an empty string. Are you
> sure you really want it to be treated as a NULL by default in this one
> place?

Yes ;-)

Otherwise, what will happen when we try to import into some non-text field
for which '' is not a valid value?

Spreadsheets commonly represent missing values as empty strings when
reading/writing CSVs - that's why this behaviour should be the default.

If you want to force it to use an empty string instead, simply specify
some unlikely value for NULL, like 'frobnitz'. But if you do, be prepared
for lots of errors unless you are importing into fields where empty string
is a valid text value.

Of course, a NOT NULL constraint will also break things, unless we went to
the MySQL method of handling insertion of NULL into a NOT NULL field ...
no I really am kidding.



---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?


Reply via email to