Re: FW: Timezone library

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Magnus Hagander <mha(at)sollentuna(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: FW: Timezone library
Date: 2004-04-30 04:53:15
Message-ID: 200404300453.i3U4rF207197@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


I have added this to CVS under src/timezone and have integrated this into
configure.

However, I am getting a compile error, probably because my OS has a
timezone function defined in time.h:

gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes
-Wmissing-declarations -O1 -Wall -Wmissing-prototypes
-Wmissing-declarations -Wpointer-arith -Wcast-align -I../../src/include
-I/usr/local/include/readline -I/usr/contrib/include -c -o localtime.o
localtime.c
In file included from private.h:91,
from localtime.c:25:
/usr/include/time.h:104: `pg_timezone' redeclared as different kind of
symbol
localtime.c:5: previous declaration of `pg_timezone'
localtime.c:203: `pg_timezone' redeclared as different kind of symbol
/usr/include/time.h:104: previous declaration of `pg_timezone'
localtime.c:933: warning: static declaration for `tzsetwall' follows
non-static
gmake: *** [localtime.o] Error 1

Fortunately only Win32 compiles this code right now.

---------------------------------------------------------------------------

Magnus Hagander wrote:
> This mail apparantly didn't make it through because it was too large.
> Resending it without the largest file, tzlib.tgz. I've put this file (+
> the patches) on http://www.hagander.net/pgsql/.
>
>
> //Magnus
>
>
> > -----Original Message-----
> > From: Magnus Hagander
> > Sent: Sunday, April 18, 2004 9:05 PM
> > To: pgsql-patches(at)postgresql(dot)org
> > Subject: Timezone library
> >
> >
> > Hi!
> >
> > Attached is a slightly modified version of Arthur David
> > Olson's timezone library for inclusion in postgresql, pending
> > review of course. This is required to give win32 working
> > timezone functions on dates before 1970. It has also been
> > indicated that it might be interesting to have such a library
> > on other platforms as well. Note that with this enabled, the
> > timezone data files are installed in <pgdir>/share/timezone.
> >
> > Attached are the following files:
> > * tzlib.tgz - the timezone implementation, including the
> > datafiles required to build the timezone data files.
> > * timezone.patch - the modifications made to existing files
> > to make it work. This includes setting the FRONTEND flat for ecpg.
> > * tzcode.diff - lists the modifications that I have made to
> > the files from the original timezone files, for reference.
> >
> >
> > Bruce has offered to do the autoconf and Makefile integration
> > parts - I don't know autoconf enough to do that part... The
> > #defines necessary are "activeted" by setting USE_PGTZ. Of
> > course, the appropriate files also have to be linked in.
> >
> >
> > With this patch applied, and the timezone data installed,
> > win32 now passes all time-related regression tests (3 now
> > fails, 2 "known" and one being locale-inflicted, still
> > investigating that one)
> >
> >
> > //Magnus
> >
> >
> >
> >
> <<tzcode_changes.diff>> <<timezone.patch>>

Content-Description: tzcode_changes.diff

[ Attachment, skipping... ]

Content-Description: timezone.patch

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2004-04-30 04:56:44 Re: Call for 7.5 feature completion
Previous Message Tom Lane 2004-04-30 04:52:10 Re: Current CVS tip segfaulting

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-04-30 05:06:13 Re: width_bucket() per SQL2003 (WIP)
Previous Message Alvaro Herrera 2004-04-30 02:12:37 Re: PITR Phase 1 - Full set of patches