Skip site navigation (1) Skip section navigation (2)

Re: COPY for CSV documentation

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: COPY for CSV documentation
Date: 2004-04-12 12:36:39
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
On Mon, Apr 12, 2004 at 08:07:12 -0400,
  Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
> Otherwise, what will happen when we try to import into some non-text field
> for which '' is not a valid value?

I would expect the copy to fail as it does normally.

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

That doesn't strike me as an overwhelming reason to do it that way.

> 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.

This concerns me. If NULL is on by default, there should be some way to
turn it off, not to change it to some value you hope won't show up in
the input stream.

In response to

pgsql-patches by date

Next:From: Tom LaneDate: 2004-04-12 12:38:19
Subject: Re: COPY for CSV documentation
Previous:From: Tom LaneDate: 2004-04-12 12:15:42
Subject: Re: Information/schema hiding...

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group