Re: [PATCHES] Integer datetime by default

2008-03-29 Thread Neil Conway
On Tue, 2008-03-25 at 12:54 -0700, Neil Conway wrote:
 Barring any objections, I'll apply this to HEAD tomorrow.

Applied to HEAD.

-Neil



-- 
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches


[PATCHES] Integer datetime by default

2008-03-25 Thread Neil Conway
Attached is a refreshed patch that makes integer datetimes the default.
Platforms that don't have a working 64-bit integer type will fail to
configure by default; they can specify --disable-integer-datetimes to
switch back to using floating-point based datetimes.

Barring any objections, I'll apply this to HEAD tomorrow.

-Neil

Index: configure
===
RCS file: /home/neilc/postgres/cvs_root/pgsql/configure,v
retrieving revision 1.587
diff -p -c -r1.587 configure
*** configure	10 Mar 2008 21:50:16 -	1.587
--- configure	25 Mar 2008 19:47:18 -
*** if test -n $ac_init_help; then
*** 1349,1355 
  Optional Features:
--disable-FEATURE   do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
!   --enable-integer-datetimes  enable 64-bit integer date/time support
--enable-nls[=LANGUAGES]  enable Native Language Support
--disable-shareddo not build shared libraries
--disable-rpath do not embed shared library search path in executables
--- 1349,1355 
  Optional Features:
--disable-FEATURE   do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
!   --disable-integer-datetimes  disable 64-bit integer date/time support
--enable-nls[=LANGUAGES]  enable Native Language Support
--disable-shareddo not build shared libraries
--disable-rpath do not embed shared library search path in executables
*** fi
*** 2176,2182 
  
  
  #
! # 64-bit integer date/time storage (--enable-integer-datetimes)
  #
  { echo $as_me:$LINENO: checking whether to build with 64-bit integer date/time support 5
  echo $ECHO_N checking whether to build with 64-bit integer date/time support... $ECHO_C 6; }
--- 2176,2182 
  
  
  #
! # 64-bit integer date/time storage: enabled by default.
  #
  { echo $as_me:$LINENO: checking whether to build with 64-bit integer date/time support 5
  echo $ECHO_N checking whether to build with 64-bit integer date/time support... $ECHO_C 6; }
*** echo $as_me: error: no argument expecte
*** 2205,2211 
esac
  
  else
!   enable_integer_datetimes=no
  
  fi
  
--- 2205,2215 
esac
  
  else
!   enable_integer_datetimes=yes
! 
! cat confdefs.h \_ACEOF
! #define USE_INTEGER_DATETIMES 1
! _ACEOF
  
  fi
  
*** fi
*** 23293,23298 
--- 23297,23322 
  
  
  
+ # If the user did not disable integer datetimes, check that
+ # there is a working 64-bit integral type to use.
+ if test x$USE_INTEGER_DATETIMES = xyes 
+test x$HAVE_LONG_INT_64 = xno 
+test x$HAVE_LONG_LONG_INT_64 = xno 
+test x$HAVE_INT64 = xno ; then
+   { { echo $as_me:$LINENO: error:
+ Integer-based datetime support requires a 64-bit integer type,
+ but no such type could be found. The --disable-integer-datetimes
+ configure option can be used to disable integer-based storage
+ of datetime values. 5
+ echo $as_me: error:
+ Integer-based datetime support requires a 64-bit integer type,
+ but no such type could be found. The --disable-integer-datetimes
+ configure option can be used to disable integer-based storage
+ of datetime values. 2;}
+{ (exit 1); exit 1; }; }
+ fi
+ 
+ 
  if test $PORTNAME != win32
  then
  { echo $as_me:$LINENO: checking for POSIX signal interface 5
Index: configure.in
===
RCS file: /home/neilc/postgres/cvs_root/pgsql/configure.in,v
retrieving revision 1.554
diff -p -c -r1.554 configure.in
*** configure.in	10 Mar 2008 21:50:16 -	1.554
--- configure.in	25 Mar 2008 19:44:55 -
*** PGAC_ARG_REQ(with, libs,  [  --with-
*** 128,137 
  
  
  #
! # 64-bit integer date/time storage (--enable-integer-datetimes)
  #
  AC_MSG_CHECKING([whether to build with 64-bit integer date/time support])
! PGAC_ARG_BOOL(enable, integer-datetimes, no, [  --enable-integer-datetimes  enable 64-bit integer date/time support],
[AC_DEFINE([USE_INTEGER_DATETIMES], 1,
   [Define to 1 if you want 64-bit integer timestamp and interval support. (--enable-integer-datetimes)])])
  AC_MSG_RESULT([$enable_integer_datetimes])
--- 128,137 
  
  
  #
! # 64-bit integer date/time storage: enabled by default.
  #
  AC_MSG_CHECKING([whether to build with 64-bit integer date/time support])
! PGAC_ARG_BOOL(enable, integer-datetimes, yes, [  --disable-integer-datetimes  disable 64-bit integer date/time support],
[AC_DEFINE([USE_INTEGER_DATETIMES], 1,
   [Define to 1 if you want 64-bit integer timestamp and interval support. (--enable-integer-datetimes)])])
  AC_MSG_RESULT([$enable_integer_datetimes])
*** AC_CHECK_TYPES([int8, uint8, int64, uint
*** 1405,1410 
--- 1405,1424 
  AC_CHECK_TYPES(sig_atomic_t, [], [], [#include signal.h])
  
  
+ # If the user did