From: | Bruce Momjian <bruce(at)momjian(dot)us> |
---|---|
To: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Subject: | Re: pg_upgrade diffs on WIndows |
Date: | 2012-09-05 20:40:54 |
Message-ID: | 20120905204054.GE8774@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, Sep 5, 2012 at 04:22:18PM -0400, Andrew Dunstan wrote:
> >>So, right now we are only add \r for function bodies, which is mostly
> >>harmless, but what if a function body has strings with an embedded
> >>newlines? What about creating a table with newlines in its identifiers:
> >>
> >>CREATE TABLE "a
> >>b" ("c
> >>d" int);
> >>
> >>If \r is added in there, it would be a data corruption problem. Can you
> >>test that?
> >
> >These are among the reasons why I am suggesting opening the file
> >in binary mode. You're right, that would be data corruption.
> >
> >I can set up a check, but it will take a bit of time.
>
>
> As expected, we get a difference in field names. Here's the extract
> from the dumps diff (* again represents CR):
>
>
> ***************
> *** 5220,5228 ****
> --
>
> CREATE TABLE hasnewline (
> ! "x
> y" integer,
> ! "a
> b" text
> );
>
> --- 5220,5228 ----
> --
>
> CREATE TABLE hasnewline (
> ! "x*
> y" integer,
> ! "a*
> b" text
> );
>
> If we open the input and output files in binary mode in pg_upgrade's
> dump.c this disappears.
>
> Given this, I think we have no choice but to apply the patch, all
> the way back to 9.0 in fact.
I think you are right.
I think I could use some "quite time" right now, as Tom suggested. ;-)
--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2012-09-05 20:45:32 | Re: plperl sigfpe reset can crash the server |
Previous Message | Kohei KaiGai | 2012-09-05 20:35:03 | Re: [bugfix] sepgsql didn't follow the latest core API changes |