Tom Lane wrote:
> Peter Eisentraut <pete...@gmx.net> writes:
> > ...  Moreover, there does not actually seem to be a 
> > way to find out whether you have a 32-bit or a 64-bit build (except by 
> > using OS tools).
> 
> I think the basic definition of "32 bit" or "64 bit", certainly for
> our purposes, is sizeof(void *).  That is something that configure
> could easily find out.  Or you could look at sizeof(size_t) which
> it already does find out.
> 
> I have no immediate proposal on how to factor that into the version
> string.

I think the pointer size is part of the compiler, rather than the
platform, so it should go after the compiler mention, e.g.:

  test=> select version();
                                    version
  --------------------------------------------------------------------------
  
   PostgreSQL 8.4devel on i386-pc-bsdi4.3.1, compiled by GCC 2.95.3, 32-bit
  (1 row)

The attached patch modifies configure.in and updates a documentation mention.

-- 
  Bruce Momjian  <br...@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
Index: configure.in
===================================================================
RCS file: /cvsroot/pgsql/configure.in,v
retrieving revision 1.577
diff -c -c -r1.577 configure.in
*** configure.in	11 Dec 2008 07:34:07 -0000	1.577
--- configure.in	31 Dec 2008 02:42:42 -0000
***************
*** 496,503 ****
  else
    cc_string=$CC
  fi
  AC_DEFINE_UNQUOTED(PG_VERSION_STR,
!                    ["PostgreSQL $PACKAGE_VERSION on $host, compiled by $cc_string"],
                     [A string containing the version number, platform, and C compiler])
  
  
--- 496,505 ----
  else
    cc_string=$CC
  fi
+ AC_CHECK_SIZEOF([void *])
+ 
  AC_DEFINE_UNQUOTED(PG_VERSION_STR,
!                    ["PostgreSQL $PACKAGE_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"],
                     [A string containing the version number, platform, and C compiler])
  
  
Index: doc/src/sgml/start.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/start.sgml,v
retrieving revision 1.47
diff -c -c -r1.47 start.sgml
*** doc/src/sgml/start.sgml	16 May 2008 17:17:00 -0000	1.47
--- doc/src/sgml/start.sgml	31 Dec 2008 02:42:47 -0000
***************
*** 362,370 ****
      <indexterm><primary>version</primary></indexterm>
  <screen>
  <prompt>mydb=&gt;</prompt> <userinput>SELECT version();</userinput>
!                             version
! ----------------------------------------------------------------
!  PostgreSQL &version; on i586-pc-linux-gnu, compiled by GCC 2.96
  (1 row)
  
  <prompt>mydb=&gt;</prompt> <userinput>SELECT current_date;</userinput>
--- 362,370 ----
      <indexterm><primary>version</primary></indexterm>
  <screen>
  <prompt>mydb=&gt;</prompt> <userinput>SELECT version();</userinput>
!                                version
!  -----------------------------------------------------------------------
!  PostgreSQL &version; on i586-pc-linux-gnu, compiled by GCC 2.96, 32-bit
  (1 row)
  
  <prompt>mydb=&gt;</prompt> <userinput>SELECT current_date;</userinput>
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to