Re: Dump produces file with new line characters

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Mark Spruill" <mark(dot)spruill(at)mightyautoparts(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Dump produces file with new line characters
Date: 2004-06-23 21:52:34
Message-ID: 6016.1088027554@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Mark Spruill" <mark(dot)spruill(at)mightyautoparts(dot)com> writes:
> Following is an excerpt from the dump file.

> COPY compmstr (alienvendorcode, alienlinecode, alienpartnumber, jobber, list, da
> te, replacedbypart, specialmarkets, discount) FROM stdin;
> 001 66 16-4002 32.50 65.65 2003-05-26 00:00:00
> \N 0.00 0.00
> 001 66 16-4003 32.50 65.65 2003-05-26 00:00:00
> \N 0.00 0.00
> 001 66 16-4006 32.50 65.65 2003-05-26 00:00:00
> \N 0.00 0.00
> 001 66 16-4013 32.50 65.65 2003-05-26 00:00:00
> \N 0.00 0.00

> See what I mean? I am wondering if there is actually a new line character in the database or if the \N is representing a NULL value?

The \N's represent nulls, yes. The question is why psql has a problem
with them. It should know that it's inside COPY data and not
misinterpret them as psql commands. This is not something that's
changed lately --- we've always handled NULLs like this --- so I'm
mystified why you are having a problem. Can you characterize the cases
in which psql gets confused?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message CSN 2004-06-23 22:54:25 Catching errors
Previous Message Mark Spruill 2004-06-23 21:35:42 Re: Dump produces file with new line characters