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

Re: Questions about pg_dump file

From: John Browne <jkbrowne(at)gmail(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Questions about pg_dump file
Date: 2004-08-28 05:07:26
Message-ID: ccc6061040827220722018a6@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
On Wed, 25 Aug 2004 23:23:23 -0400 (EDT), Bruce Momjian
<pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
> John Browne wrote:
> > I had a-couple of questions regarding the text formatting in the pg_dump file.
> >
> > First, when dumping my database, I seem to be getting inconsistent
> > end-of-line characters.  Some lines end with the *NIX-style \n and
> > some end with Windows-style \r\n.  Now, I have created this database
> > over about a-year or so and I have tested various clients (psql,
> > pgadminIII, etc) during that time.  I'm suspecting they are coming
> > from one of the Windows clients, but shouldn't the \r\n end-of-line
> > characters be converted to \n when a dump is created?  Is this the
> > expected behavior?  I know the output of pg_dump could be piped
> > through perl or sed or something to strip/convert them.  I just didn't
> > know if there was an easier way.
> 
> We should handle \n or \r\n just fine, though there is a fix in 7.4.5
> for that.

Oh, pg_dump handles it just fine, but the problem is you end up with a
mixture of different EOL characters in the dump file.  Shouldn't
pg_dump create the dump file with consistent \n *NIX style EOL
characters throughout the entire file, instead of carrying over the
\r\n EOL characters from user-defined function definitions, views,
etc.?

The only reason I stumbled across the fact there were \r\n characters
in the dump file is because I started versioning my postgres schema in
my Subversion repository. :-)  Just thought it was odd the \r\n
characters were there..

In response to

Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2004-08-28 16:07:12
Subject: Re: Questions about pg_dump file
Previous:From: Eduardo Vázquez RodríguezDate: 2004-08-27 23:16:17
Subject: Re: Query

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