Thread: BUG #10701: pg_dumpall.exe adds 0x0d to table comments

BUG #10701: pg_dumpall.exe adds 0x0d to table comments

From
mundus13@yahoo.de
Date:
The following bug has been logged on the website:

Bug reference:      10701
Logged by:          Michael
Email address:      mundus13@yahoo.de
PostgreSQL version: 9.3.4
Operating system:   Windows 7 64Bit
Description:

When pg_dumpall.exe exports a table which contains 0x0d 0x0a in the table
comment
an additional \x0d is added to the export file.

Repro:

CREATE TABLE public.test2 (
...

COMMENT ON TABLE public.test2
IS 'desc1
desc2
';

Tablespace Hexdump
0003eb00  8f e0 00 00 eb 04 00 00  00 00 00 00 1f 64 65 73
|.............des|
0003eb10  63 31 0d 0a 64 65 73 63  32 0d 0a 00 00 00 00 00
|c1..desc2.......|


pg_dumpall.exe -p 5432 -U postgres  > e:\db_export_2014-06-19_V02

Export file hexdump
00010970  20 4f 77 6e 65 72 3a 20  70 6f 73 74 67 72 65 73  | Owner:
postgres|
00010980  0d 0a 2d 2d 0d 0a 0d 0a  43 4f 4d 4d 45 4e 54 20  |..--....COMMENT
|
00010990  4f 4e 20 54 41 42 4c 45  20 74 65 73 74 32 20 49  |ON TABLE test2
I|
000109a0  53 20 27 64 65 73 63 31  0d 0d 0a 64 65 73 63 32  |S
'desc1...desc2|
000109b0  0d 0d 0a 27 3b 0d 0a 0d  0a 0d 0a 2d 2d 0d 0a 2d
|...';......--..-|


Version
PostgreSQL 9.3.4, compiled by Visual C++ build 1600, 64-bit
pg_dumpall (PostgreSQL) 9.3.4
Windows 7 Codepage: 850

Re: BUG #10701: pg_dumpall.exe adds 0x0d to table comments

From
Bruce Momjian
Date:
On Thu, Jun 19, 2014 at 11:29:44AM +0000, mundus13@yahoo.de wrote:
> The following bug has been logged on the website:
>
> Bug reference:      10701
> Logged by:          Michael
> Email address:      mundus13@yahoo.de
> PostgreSQL version: 9.3.4
> Operating system:   Windows 7 64Bit
> Description:
>
> When pg_dumpall.exe exports a table which contains 0x0d 0x0a in the table
> comment
> an additional \x0d is added to the export file.
>
> Repro:
>
> CREATE TABLE public.test2 (
> ...
>
> COMMENT ON TABLE public.test2
> IS 'desc1
> desc2
> ';

I looked into this and I can't see why only COMMENT ON TABLE would be
affected.  Does it cause other problems?

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +