From: Bruno Wolff III <bruno@wolff.to>
To: Jason Godden <jasongodden@optushome.com.au>
Cc: expect <expect@ihubbell.com>
Cc: pgsql-general@postgresql.org
Subject: Re: importing db as text files
Date: Thu, 14 Aug 2003 08:57:25 -0500
Message-ID: <20030814135725.GE27870@wolff.to> (raw)
In-Reply-To: <200308141450.41485.jasongodden@optushome.com.au>
References: <71E37EF6B7DCC1499CEA0316A2568328DC9819@loki.globexplorer.com>
<20030813211701.031090a6.expect@ihubbell.com>
<200308141450.41485.jasongodden@optushome.com.au>
On Thu, Aug 14, 2003 at 14:50:41 +1000,
Jason Godden <jasongodden@optushome.com.au> wrote:
>
> Copy can accept an empty field (representing null):
That assumes that an empty field is what he means by 'no value'.
For some data types an empty string is a perfectly valid data type.
> copy datatable from stdin delimiter '\t' null '';
>
> by default pg expects '\N' to mean null but you can override it:
He wants the default value, not null though. Copy doesn't have a way
to specify a string to be replaced by the default value. It probably
wouldn't be too hard to add this option, but it is too late for 7.4.
If the default value is a constant preprocessing should be an easy way
to handle the issue. Another option may be to change null's to the
default after importing the data (assuming there aren't actual nulls
in the data). If he is trying to use nextval for all rows on one column,
then not entering that column would be the way to go.
We haven't seen any example of the data he is trying to import so it is
hard to give him specific advice.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: bruno@wolff.to, jasongodden@optushome.com.au, expect@ihubbell.com
Subject: Re: importing db as text files
In-Reply-To: <20030814135725.GE27870@wolff.to>
References: <71E37EF6B7DCC1499CEA0316A2568328DC9819@loki.globexplorer.com> <20030813211701.031090a6.expect@ihubbell.com> <200308141450.41485.jasongodden@optushome.com.au> <20030814135725.GE27870@wolff.to>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox