Re: pg_dump/pg_restore seem broken on hamerkop

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_dump/pg_restore seem broken on hamerkop
Дата
Msg-id 17276.1414369759@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pg_dump/pg_restore seem broken on hamerkop  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pg_dump/pg_restore seem broken on hamerkop
Список pgsql-hackers
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
containcharacters in various random    * encodings; this has been seen to cause encoding errors when reading the    *
dumpscript.    */
 

I'm going to go revert most of that commit and make the code like it
was before:
   if (strftime(buf, sizeof(buf),
#ifndef WIN32                "%Y-%m-%d %H:%M:%S %Z",
#else                "%Y-%m-%d %H:%M:%S",
#endif                localtime(&now)) != 0)

If somebody wants to have timezones printed on Windows, they can
try again, but they're gonna have to work harder than this.

It's possible that fixing this will not fix whatever's bothering
hamerkop, but given the lack of backward-portability of %z, this
code has got to go anyway.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump/pg_restore seem broken on hamerkop
Следующее
От: David Rowley
Дата:
Сообщение: Re: [PATCH] Simplify EXISTS subqueries containing LIMIT