Re: Australian timezone configure option

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Chris Dunlop <chris(at)onthe(dot)net(dot)au>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Australian timezone configure option
Date: 2001-06-12 16:26:20
Message-ID: 200106121626.f5CGQLY17403@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Here is a new version of the patch.
>
> It's still horridly ugly. Why not put the three Aussie-specific entries
> in a separate aussie_datetktbl array, and have the lookup look like
>
> if (Australian_timezones)
> {
> tp = datebsearch(lowtoken, aussie_datetktbl, sz_aussie_datetktbl);
> if (tp == NULL)
> tp = datebsearch(lowtoken, datetktbl, szdatetktbl);
> }
> else
> tp = datebsearch(lowtoken, datetktbl, szdatetktbl);
>
> instead of modifying the lookup table on the fly.

I thought about that but the use of the cache had me concerned,
particularly for modularity. This way there is only one table to query
with one call to the bsearch function.

However, I can go with the two-table approach if people prefer it.

> > I found I didn't need to clear the date cache.
>
> Hmm, are you sure about that? I'm not.

I checked and it caches a pointer to the struct, not the values
themselves, and we don't change the structure, just the secondary values
and not the key used by the bsearch.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-06-12 16:27:44 Re: Patch to include PAM support...
Previous Message Peter Eisentraut 2001-06-12 16:24:57 Re: Patch to include PAM support...

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2001-06-12 16:27:44 Re: Patch to include PAM support...
Previous Message Peter Eisentraut 2001-06-12 16:24:57 Re: Patch to include PAM support...