Re: Australian timezone configure option - Mailing list pgsql-patches

From Tom Lane
Subject Re: Australian timezone configure option
Date
Msg-id 7941.992328923@sss.pgh.pa.us
Whole thread Raw
In response to Re: Australian timezone configure option  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Australian timezone configure option
List pgsql-patches
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> OK, this patch makes Australian_timezones a GUC option.  It can be set
> anytime in psql.  The code uses a static variable to check if the GUC
> setting has changed and adjust the C struct accordingly.

This is a horrid approach.  What if you get an error partway through
scribbling on the static table?  Then you've got inconsistent data.

Nor do I much care for having to execute a check subroutine before any
use of the lookup table (quite aside from speed, are you sure it's being
called before *every* use of the table?  how will you make sure that
people remember to call it when they add new routines that use the
table?).  If you're going to scribble on the table, ISTM you should
drive that off an assignment-hook callback from the GUC stuff.

Besides which, you forgot to mark the control variable static...
so it doesn't actually reflect the state of the table.

It would be a lot cleaner to extend the lookup table structure so that
you don't need to change the table contents to track the Aussie-rules
setting.

            regards, tom lane

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Australian timezone configure option
Next
From: "Hiroshi Inoue"
Date:
Subject: RE: 7.1 odbc bug & patch