Re: pg_dump/pg_restore seem broken on hamerkop - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: pg_dump/pg_restore seem broken on hamerkop
Date
Msg-id 20141127162411.GD16294@momjian.us
Whole thread Raw
In response to Re: pg_dump/pg_restore seem broken on hamerkop  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sun, Oct 26, 2014 at 08:29:19PM -0400, Tom Lane wrote:
> I wrote:
> > Hm.  %z ought not be locale-dependent ... however, it has a bigger
> > problem, which is that it's a C99-ism.  It's not there in SUSv2,
> > which is our normal baseline for what's portable.  I think we need
> > to get rid of that.  %Z should be portable.
> 
> > (Is it possible that Windows' strftime() reads %z as doing something
> > other than what C99 says?)
> 
> A bit of googling leads me to Microsoft reference material saying that
> their strftime treats %z and %Z alike.  So in point of fact, the
> assumption underlying commit ad5d46a4494b0b48 was flat out wrong.
> Switching to %z doesn't get you out of the problem noted in the
> comments it removed:
> 
>     /*
>      * We don't print the timezone on Win32, because the names are long and
>      * localized, which means they may contain characters in various random
>      * encodings; this has been seen to cause encoding errors when reading the
>      * dump script.
>      */
> 
> I'm going to go revert most of that commit and make the code like it
> was before:

Thanks.  The major goal of the patch was to get a timezone designation
in there, and you have done that were possible, which is non-Windows. 
Your C comment clearly explained why Windows is a problem, and
centralized the code.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + Everyone has their own god. +



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [pgsql-packagers] Palle Girgensohn's ICU patch
Next
From: Fujii Masao
Date:
Subject: Re: pg_isready: Missing translation macros.