Re: Australian timezone configure option

From: Chris Dunlop <chris(at)onthe(dot)net(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Australian timezone configure option
Date: 2001-06-05 23:55:30
Message-ID: 20010606095530.A11781@minotaur.onthe.net.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Mon, Jun 04, 2001 at 10:25:02AM -0400, Tom Lane wrote:
> Chris Dunlop <chris(at)onthe(dot)net(dot)au> writes:
> > This patch makes it a configure option - much easier to use,
>
> Seems like a good idea, but that patch couldn't possibly work as-is.
> Where's the config.h.in entry? Have you tested it?
>
> regards, tom lane

Oops... overzealeous trimming of the actual patch file I generated
which included all the changes to 'configure' generated by autoconf.

Patch including config.h.in changes below.

Test against the unpatched database, local timezone is "Australian EST"
i.e. GMT+10:

$ psql -c "select 'Jun 6 02:34:32 EST 2001'::datetime" template1
?column?
------------------------
2001-06-06 17:34:32+10
(1 row)

Notice the returned time is different to the input time. Against
the patched database:

psql -c "select 'Jun 6 02:34:32 EST 2001'::datetime" template1
?column?
------------------------
2001-06-06 02:34:32+10
(1 row)

Cheers,

Chris,
OnTheNet

diff -ru postgresql-7.1.2.orig/configure.in postgresql-7.1.2/configure.in
--- postgresql-7.1.2.orig/configure.in Fri May 11 11:34:39 2001
+++ postgresql-7.1.2/configure.in Thu May 31 23:54:27 2001
@@ -150,6 +150,16 @@


#
+# Australian timezone (--enable-australian-tz)
+#
+AC_MSG_CHECKING([whether to build with Australian timezone rules])
+PGAC_ARG_BOOL(enable, australian-tz, no, [ --enable-australian-tz enable Australian timezone rules ],
+ [AC_DEFINE([USE_AUSTRALIAN_RULES], 1,
+ [Set to 1 if you want Australian timezone rules (--enable-australian-tz)])])
+AC_MSG_RESULT([$enable_australian_tz])
+
+
+#
# Locale (--enable-locale)
#
AC_MSG_CHECKING([whether to build with locale support])
diff -ru postgresql-7.1.2.orig/src/include/config.h.in postgresql-7.1.2/src/include/config.h.in
--- postgresql-7.1.2.orig/src/include/config.h.in Sun Apr 15 08:55:02 2001
+++ postgresql-7.1.2/src/include/config.h.in Thu May 31 23:58:16 2001
@@ -33,6 +33,9 @@
/* A canonical string containing the version number, platform, and C compiler */
#undef PG_VERSION_STR

+/* Set to 1 if you want Australian timezone rules (--enable-australian-tz) */
+#undef USE_AUSTRALIAN_RULES
+
/* Set to 1 if you want LOCALE support (--enable-locale) */
#undef USE_LOCALE

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-06-06 00:01:02 Idea: quicker abort after loss of client connection
Previous Message Bruce Irvine 2001-06-05 23:47:10 URGENT PROBLEM

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2001-06-06 00:03:24 Re: Australian timezone configure option
Previous Message Karel Zak 2001-06-05 09:30:41 Re: Re: [PATCHES] Re: AW: Re: Support for %TYPE in CREATE FUNCTION