Re: Australian timezone configure option

Chris Dunlop <chris@onthe.net.au>

From: Chris Dunlop <chris@onthe.net.au>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-patches@postgresql.org
Date: 2001-06-05T23:55:30Z
Lists: pgsql-hackers
On Mon, Jun 04, 2001 at 10:25:02AM -0400, Tom Lane wrote:
> Chris Dunlop <chris@onthe.net.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