Re: Dump produces file with new line characters

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

Tom,

I have solved the problem. I don't know exactly what I did, but I think it had something to do with a screwed up "template1". When I first tried to load the database, I connected to template1 instead of the database I wanted to load. Things went down hill from there. So I finally just re-initialized the whole database cluster and now it seems to be working OK. I guess this one was just stupid user error, but I learned a lesson. Don't mess with template1!

Thanks for your help,

Mark

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Wednesday, June 23, 2004 5:53 PM
To: Mark Spruill
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Dump produces file with new line characters

"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

Browse pgsql-general by date

  From Date Subject
Next Message Tatsuo Ishii 2004-06-24 14:27:24 Re: unicode and sorting(at least)
Previous Message Jeff 2004-06-24 14:07:11 Re: PostgreSQL Optimizer