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

Re: COPY incorrectly uses null instead of an empty string in last field

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: COPY incorrectly uses null instead of an empty string in last field
Date: 2002-02-26 21:44:06
Message-ID: 5719.1014759846@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
> The original reporter's mail had no tabs at all, but it was not an
> attachment and it had had lost all its tabs along the way.  His input
> script came from 7.0 pg_dump.  I am following up with him whether there
> are actually tabs before the empty fields in that pg_dump output.

If a trailing tab got lost in a dump file, then COPY IN would silently
assume that fields after the tab position should be NULL.  I suspect
that that is what happened here.  Probably some "helpful" program
stripped trailing whitespace from the file.

One of the things we've agreed to do in 7.3 is change COPY IN to remove
that assumption --- a line with too few fields (too few tabs) will draw
an error report instead of silently doing what's likely the wrong thing.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Jean-Michel POUREDate: 2002-02-26 22:04:43
Subject: Re: PostgreSQL 8.0 ??
Previous:From: Oliver ElphickDate: 2002-02-26 21:27:43
Subject: Re: COPY incorrectly uses null instead of an empty string

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