Re: Questions about pg_dump file

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: John Browne <jkbrowne(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Questions about pg_dump file
Date: 2004-08-26 03:23:23
Message-ID: 200408260323.i7Q3NNO03305@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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.

> Second question... I have noticed that a pg_dump file keeps the text
> formatting, ie, tabs, spaces, etc. for any user-defined functions.
> The function looks like it should, and is readable, in the pg_dump
> file, with all of it's formatting. A view, however, ends up all on
> the same line. This is fine for simple views, but for more
> complicated view definitions it can be difficult to read. Is there a
> way to get postgres/pg_dump to keep it's text formatting (tabs,
> spaces, etc) for the view definitions like it does for functions? Or
> is this even feasable?

This is improved in 8.0beta1.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Kunal 2004-08-26 03:50:21 Re: MySQL vs PostgreSQL
Previous Message Gaetano Mendola 2004-08-26 01:51:01 Re: "between" is using index but "like" is not