Re: date/time compatible problems in 7.2

From: Thomas Lockhart <lockhart(at)fourpalms(dot)org>
To: Ruslan A Dautkhanov <rusland(at)scn(dot)ru>
Cc: Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: date/time compatible problems in 7.2
Date: 2002-02-21 14:30:37
Message-ID: 3C75048D.77026B4D@fourpalms.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

(back on list)

> > Not sure why it is crashing. But "KRAT" is a time zone not recognized by
> > the PostgreSQL date/time parser. In fact it could be afaik (it is
> > mentioned but commented-out in the parser) but it either had a screwy
> > definition or I couldn't figure out what the definition was. It could be
> > added for 7.2.1 (and I could send a patch beforehand) if I knew the
> > proper definition. Check src/backend/utils/adt/datetime.c and look for
> > "krat".
> KRAT,KRAST is timezone code generated by FreeBSD automatically.
> You can check up /usr/share/zoneinfo - it have all timezones.
> You can see timezones KRAT,KRAST in file
> /usr/share/zoneinfo/Asia/Krasnoyarsk.

Nope. You will have to *please* give me more details. On my Linux
(Mandrake) systems the zoneinfo data is included in the glibc package,
and the Asia/Krasnoyarsk entries refer to "Krasnoyarsk" not to "KRAT" or
any other abbreviation. They also seem to be empty of any other useful
information. I'm not sure where I got the original reference to "krat"
to include as a placeholder in the code.

> I already break idea to pg_dump in 7.1.3 and pg_restore in 7.2 and
> tried to remove ' KRAT' substring from all my *.dat files, created by
> pg_dump and change schema to fields without timezone. After I tried
> pg_restore only data from dbdump-file, but pg_restore says, that
> can't initialize header from TOC-file, but I not even touched it.
> TOC - is only one binary file in dbdump-file. I think that it also have
> smth like CRC code about all other files, and this is reason why they
> say that can't initialize TOC-file?

Not sure.

> How to patch datetime.c to 7.2 permit my 'KRAT' timezone?

Look in src/backend/utils/adt/datetime.c and search for "krat". Add a
line outside of the #if 0 block which looks like the other enabled time
zones, including your time zone offset in *minutes* from UTC. Recompile
and reinstall and you should be ready to go. initdb not required.

Send me details on the krat time zone and another zone you see disabled
in datetime.c and it will be in 7.2.1...

- Thomas

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 2002-02-21 14:37:37 Re: Why Bruce is no longer allowed to post to -hackers ...
Previous Message Hervé Piedvache 2002-02-21 14:26:23 Re: Trouble with pg_dumpall import with 7.2