Re: strangeness in pg_dump

Lists: pgsql-general
From: Mathieu Arnold <mat(at)mat(dot)cc>
To: pgsql-general(at)postgresql(dot)org
Cc: terry(at)greatgulfhomes(dot)com, Jan Wieck <janwieck(at)yahoo(dot)com>
Subject: Re: strangeness in pg_dump
Date: 2002-06-03 13:50:23
Message-ID: 3449096969.1023119423@andromede.reaumur.absolight.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

--On lundi 3 juin 2002 09:35 -0400 Jan Wieck <janwieck(at)yahoo(dot)com> wrote:

> Mathieu Arnold wrote:
>> Hi
>>
>> I have 2 servers, a linux and a freebsd, and I don't understand why when
>> I dump on one, the dumped strings looks like :
>>
>> "foo\r\nbar"
>>
>> and on the other one :
>>
>> "foo^M\
>> bar"
>>
>> does someone have an idea of what compile time option is responsible for
>> that ?
>
> Looks identical to me.

well, they do not I believe.

> ^M == \r == 0x0D == Carriage Return
> \ (at end of line) == \n == 0x0A == New Line

that is right, but, in the first case, it is not '\r' + '\n' but '\\' + 'r'
+ '\\' + '\n'

> Maybe you should use fully compatible commands to examine the
> data?

--On lundi 3 juin 2002 09:31 -0400 terry(at)greatgulfhomes(dot)com wrote:

> Are you sure the files are different format???

well, I use :
pg_dump -c -h pgsqlhost -h file database
on the 2 servers, the database being on another server...
I don't understand.

--
Mathieu Arnold


From: Jan Wieck <janwieck(at)yahoo(dot)com>
To: Mathieu Arnold <mat(at)mat(dot)cc>
Cc: pgsql-general(at)postgresql(dot)org, terry(at)greatgulfhomes(dot)com, Jan Wieck <janwieck(at)yahoo(dot)com>
Subject: Re: strangeness in pg_dump
Date: 2002-06-03 14:08:47
Message-ID: 200206031408.g53E8m202539@saturn.janwieck.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Mathieu Arnold wrote:
>
>
> --On lundi 3 juin 2002 09:35 -0400 Jan Wieck <janwieck(at)yahoo(dot)com> wrote:
>
> > ^M == \r == 0x0D == Carriage Return
> > \ (at end of line) == \n == 0x0A == New Line
>
> that is right, but, in the first case, it is not '\r' + '\n' but '\\' + 'r'
> + '\\' + '\n'

You're right. Shouldn't do anything before beeing done with
at least my first coffee.

Okay, need to look at the code in pg_dump the decides if to
quote or not.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #


From: Mathieu Arnold <mat(at)mat(dot)cc>
To: Jan Wieck <janwieck(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: strangeness in pg_dump
Date: 2002-06-03 14:13:06
Message-ID: 3450459438.1023120785@andromede.reaumur.absolight.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

--On lundi 3 juin 2002 10:08 -0400 Jan Wieck <janwieck(at)yahoo(dot)com> wrote:

> Mathieu Arnold wrote:
>>
>>
>> --On lundi 3 juin 2002 09:35 -0400 Jan Wieck <janwieck(at)yahoo(dot)com> wrote:
>>
>> > ^M == \r == 0x0D == Carriage Return
>> > \ (at end of line) == \n == 0x0A == New Line
>>
>> that is right, but, in the first case, it is not '\r' + '\n' but '\\' +
>> 'r' + '\\' + '\n'
>
> You're right. Shouldn't do anything before beeing done with
> at least my first coffee.
>
> Okay, need to look at the code in pg_dump the decides if to
> quote or not.

that was what I was doing, but my grep "['\"]\\\\[rn]['\"]" was not helping
me very much.

--
Mathieu Arnold


From: Jan Wieck <janwieck(at)yahoo(dot)com>
To: Mathieu Arnold <mat(at)mat(dot)cc>
Cc: Jan Wieck <janwieck(at)yahoo(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: strangeness in pg_dump
Date: 2002-06-03 14:34:02
Message-ID: 200206031434.g53EY2Y02662@saturn.janwieck.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Mathieu Arnold wrote:
>
>
> --On lundi 3 juin 2002 10:08 -0400 Jan Wieck <janwieck(at)yahoo(dot)com> wrote:
>
> > Okay, need to look at the code in pg_dump the decides if to
> > quote or not.
>
> that was what I was doing, but my grep "['\"]\\\\[rn]['\"]" was not helping
> me very much.

I don't anything that could cause this in v7.2.1's pg_dump.
Are the two servers running identical configurations (not
only PG version, but multibyte support and encoding too)?

For that matter, what version(s) are you running?

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #


From: Mathieu Arnold <mat(at)mat(dot)cc>
To: Jan Wieck <janwieck(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: strangeness in pg_dump
Date: 2002-06-03 14:39:26
Message-ID: 3452039380.1023122365@andromede.reaumur.absolight.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

--On lundi 3 juin 2002 10:34 -0400 Jan Wieck <janwieck(at)yahoo(dot)com> wrote:

> Mathieu Arnold wrote:
>>
>>
>> --On lundi 3 juin 2002 10:08 -0400 Jan Wieck <janwieck(at)yahoo(dot)com> wrote:
>>
>> > Okay, need to look at the code in pg_dump the decides if to
>> > quote or not.
>>
>> that was what I was doing, but my grep "['\"]\\\\[rn]['\"]" was not
>> helping me very much.
>
> I don't anything that could cause this in v7.2.1's pg_dump.
> Are the two servers running identical configurations (not
> only PG version, but multibyte support and encoding too)?
>
> For that matter, what version(s) are you running?

both have multibyte support, both encoding LATIN9 (france, euro)
7.2 on the linux, 7.2.1 on the freebsd

--
Mathieu Arnold


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mathieu Arnold <mat(at)mat(dot)cc>
Cc: Jan Wieck <janwieck(at)yahoo(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: strangeness in pg_dump
Date: 2002-06-03 23:48:19
Message-ID: 13090.1023148099@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Mathieu Arnold <mat(at)mat(dot)cc> writes:
>> For that matter, what version(s) are you running?

> both have multibyte support, both encoding LATIN9 (france, euro)
> 7.2 on the linux, 7.2.1 on the freebsd

In that case I think the difference is explained by this 7.2.1 patch:

2002-02-12 16:25 tgl

* doc/src/sgml/ref/copy.sgml, src/backend/commands/copy.c: Modify
COPY TO to emit carriage returns and newlines as backslash escapes
(backslash-r, backslash-n) for protection against
newline-conversion munging. In future we will also tweak COPY
FROM, but this part of the change should be backwards-compatible.
Per pghackers discussion. Also, update COPY reference page to
describe the backslash conversions more completely and accurately.

regards, tom lane