Re: version() output vs. 32/64 bits

Lists: pgsql-hackers
From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: version() output vs. 32/64 bits
Date: 2008-12-30 08:42:06
Message-ID: 4959DEDE.30905@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

It has been pointed out to me that the output of the version() function
is becoming more confusing in face of mixed 32/64 bit environments.
Output like i486-pc-linux-gnu just says what kind of kernel the build
environment has, not whether you actually have a IA-32 build.
Conversely, amd64-pc-linux-gnu could very well be a 32-bit build.
Solaris similar issues. 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'm not quite sure yet how to address this. Do others have similar
experiences or certain information requirements? Other ideas?


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: version() output vs. 32/64 bits
Date: 2008-12-30 15:35:35
Message-ID: 15302.1230651335@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)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.

regards, tom lane


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: version() output vs. 32/64 bits
Date: 2008-12-31 02:45:01
Message-ID: 200812310245.mBV2j1j05596@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)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 <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/pgpatches/64-bit text/x-diff 2.0 KB

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: version() output vs. 32/64 bits
Date: 2008-12-31 10:46:42
Message-ID: 495B4D92.3000406@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian wrote:
> Tom Lane wrote:
>> Peter Eisentraut <peter_e(at)gmx(dot)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.

You forgot a certain another build system ;-)

Should be trivial to add there though, if we choose to do it this way,
so that's not an objection in general.

//Magnus


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: version() output vs. 32/64 bits
Date: 2008-12-31 11:51:44
Message-ID: 200812311351.45057.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wednesday 31 December 2008 04:45:01 Bruce Momjian wrote:
> Tom Lane wrote:
> > Peter Eisentraut <peter_e(at)gmx(dot)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.:

I'm not really sure about that.

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

Maybe we should separate all that, e.g.,

SELECT version(); => 'PostgreSQL 8.4devel'
SELECT pg_host_os(); => 'bsdi4.3.1'
SELECT pg_host_cpu(); => 'i386' (although this is still faulty, as per my
original argument; needs some thought)
SELECT pg_compiler(); => 'GCC 2.95.3'
SELECT pg_pointer_size(); => 4 (or 32) (this could also be a SHOW variable)


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: version() output vs. 32/64 bits
Date: 2008-12-31 15:49:03
Message-ID: 26761.1230738543@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> On Wednesday 31 December 2008 04:45:01 Bruce Momjian wrote:
>> PostgreSQL 8.4devel on i386-pc-bsdi4.3.1, compiled by GCC 2.95.3, 32-bit

> Maybe we should separate all that, e.g.,

> SELECT version(); => 'PostgreSQL 8.4devel'
> SELECT pg_host_os(); => 'bsdi4.3.1'
> SELECT pg_host_cpu(); => 'i386' (although this is still faulty, as per my
> original argument; needs some thought)
> SELECT pg_compiler(); => 'GCC 2.95.3'
> SELECT pg_pointer_size(); => 4 (or 32) (this could also be a SHOW variable)

Seems like serious overkill. No one has asked for access to individual
components of the version string, other than the PG version number
itself, which we already dealt with.

I didn't actually see a user request for finding out the pointer width,
either, but if there is one then Bruce's proposal seems fine.

regards, tom lane


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: version() output vs. 32/64 bits
Date: 2008-12-31 15:54:07
Message-ID: 20081231155407.GC3809@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > On Wednesday 31 December 2008 04:45:01 Bruce Momjian wrote:
> >> PostgreSQL 8.4devel on i386-pc-bsdi4.3.1, compiled by GCC 2.95.3, 32-bit
>
> > Maybe we should separate all that, e.g.,
>
> > SELECT version(); => 'PostgreSQL 8.4devel'
> > SELECT pg_host_os(); => 'bsdi4.3.1'
> > SELECT pg_host_cpu(); => 'i386' (although this is still faulty, as per my
> > original argument; needs some thought)
> > SELECT pg_compiler(); => 'GCC 2.95.3'
> > SELECT pg_pointer_size(); => 4 (or 32) (this could also be a SHOW variable)
>
> Seems like serious overkill. No one has asked for access to individual
> components of the version string, other than the PG version number
> itself, which we already dealt with.

Maybe we could have a separate function which returned the info in
various columns (OUT params). Maybe it would be useful to normalize the
info as reported the buildfarm, which right now is a bit ad-hoc.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: version() output vs. 32/64 bits
Date: 2008-12-31 16:22:50
Message-ID: 200812311622.mBVGMoL00494@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > On Wednesday 31 December 2008 04:45:01 Bruce Momjian wrote:
> >> PostgreSQL 8.4devel on i386-pc-bsdi4.3.1, compiled by GCC 2.95.3, 32-bit
>
> > Maybe we should separate all that, e.g.,
>
> > SELECT version(); => 'PostgreSQL 8.4devel'
> > SELECT pg_host_os(); => 'bsdi4.3.1'
> > SELECT pg_host_cpu(); => 'i386' (although this is still faulty, as per my
> > original argument; needs some thought)
> > SELECT pg_compiler(); => 'GCC 2.95.3'
> > SELECT pg_pointer_size(); => 4 (or 32) (this could also be a SHOW variable)
>
> Seems like serious overkill. No one has asked for access to individual
> components of the version string, other than the PG version number
> itself, which we already dealt with.
>
> I didn't actually see a user request for finding out the pointer width,
> either, but if there is one then Bruce's proposal seems fine.

It is true no one asked for this information except Peter (I assume for
just academic reasons), and I don't think we care from a bug reporting
perspective, so I will just keep the patch around in case we ever want it.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: version() output vs. 32/64 bits
Date: 2008-12-31 16:46:23
Message-ID: 20081231164623.GI3809@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian wrote:
> Tom Lane wrote:

> > I didn't actually see a user request for finding out the pointer width,
> > either, but if there is one then Bruce's proposal seems fine.
>
> It is true no one asked for this information except Peter (I assume for
> just academic reasons),

Huh, count us (Command Prompt) as another requestor, and not for
academic reasons (in case that adds value to the vote).

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: version() output vs. 32/64 bits
Date: 2008-12-31 18:03:21
Message-ID: 200812312003.21760.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wednesday 31 December 2008 18:22:50 Bruce Momjian wrote:
> It is true no one asked for this information except Peter (I assume for
> just academic reasons),

no


From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, "Bruce Momjian" <bruce(at)momjian(dot)us>
Subject: Re: version() output vs. 32/64 bits
Date: 2008-12-31 18:13:03
Message-ID: 162867790812311013k27276e8ek8ddbe4968264965a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello

2008/12/31 Alvaro Herrera <alvherre(at)commandprompt(dot)com>:
> Tom Lane wrote:
>> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
>> > On Wednesday 31 December 2008 04:45:01 Bruce Momjian wrote:
>> >> PostgreSQL 8.4devel on i386-pc-bsdi4.3.1, compiled by GCC 2.95.3, 32-bit
>>
>> > Maybe we should separate all that, e.g.,
>>
>> > SELECT version(); => 'PostgreSQL 8.4devel'
>> > SELECT pg_host_os(); => 'bsdi4.3.1'
>> > SELECT pg_host_cpu(); => 'i386' (although this is still faulty, as per my
>> > original argument; needs some thought)
>> > SELECT pg_compiler(); => 'GCC 2.95.3'
>> > SELECT pg_pointer_size(); => 4 (or 32) (this could also be a SHOW variable)
>>
>> Seems like serious overkill. No one has asked for access to individual
>> components of the version string, other than the PG version number
>> itself, which we already dealt with.
>
> Maybe we could have a separate function which returned the info in
> various columns (OUT params). Maybe it would be useful to normalize the
> info as reported the buildfarm, which right now is a bit ad-hoc.
>

All should be GUC read only variables - It is cheep.

regards
Pavel Stehule

> --
> Alvaro Herrera http://www.CommandPrompt.com/
> The PostgreSQL Company - Command Prompt, Inc.
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Cc: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, "Bruce Momjian" <bruce(at)momjian(dot)us>
Subject: Re: version() output vs. 32/64 bits
Date: 2008-12-31 18:25:34
Message-ID: 13242.1230747934@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com> writes:
> 2008/12/31 Alvaro Herrera <alvherre(at)commandprompt(dot)com>:
>> Maybe we could have a separate function which returned the info in
>> various columns (OUT params). Maybe it would be useful to normalize the
>> info as reported the buildfarm, which right now is a bit ad-hoc.

> All should be GUC read only variables - It is cheep.

Not as cheap as a single added function. If we need to provide these
fields broken out --- and no one has demonstrated any need to do so ---
then I'd support Alvaro's suggestion.

regards, tom lane


From: David Fetter <david(at)fetter(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: version() output vs. 32/64 bits
Date: 2008-12-31 19:17:01
Message-ID: 20081231191701.GN12815@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Dec 31, 2008 at 01:25:34PM -0500, Tom Lane wrote:
> "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com> writes:
> > 2008/12/31 Alvaro Herrera <alvherre(at)commandprompt(dot)com>:
> >> Maybe we could have a separate function which returned the info
> >> in various columns (OUT params). Maybe it would be useful to
> >> normalize the info as reported the buildfarm, which right now is
> >> a bit ad-hoc.
>
> > All should be GUC read only variables - It is cheep.
>
> Not as cheap as a single added function. If we need to provide
> these fields broken out --- and no one has demonstrated any need to
> do so --- then I'd support Alvaro's suggestion.

+1 for broken-out fields in columns per Alvaro.

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: version() output vs. 32/64 bits
Date: 2009-01-05 12:29:52
Message-ID: 1231158592.2497.10.camel@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Bruce Momjian píše v st 31. 12. 2008 v 11:22 -0500:
> Tom Lane wrote:
> > Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > > On Wednesday 31 December 2008 04:45:01 Bruce Momjian wrote:
> > >> PostgreSQL 8.4devel on i386-pc-bsdi4.3.1, compiled by GCC 2.95.3, 32-bit
> >
> > > Maybe we should separate all that, e.g.,
> >
> > > SELECT version(); => 'PostgreSQL 8.4devel'
> > > SELECT pg_host_os(); => 'bsdi4.3.1'
> > > SELECT pg_host_cpu(); => 'i386' (although this is still faulty, as per my
> > > original argument; needs some thought)
> > > SELECT pg_compiler(); => 'GCC 2.95.3'
> > > SELECT pg_pointer_size(); => 4 (or 32) (this could also be a SHOW variable)
> >
> > Seems like serious overkill. No one has asked for access to individual
> > components of the version string, other than the PG version number
> > itself, which we already dealt with.
> >
> > I didn't actually see a user request for finding out the pointer width,
> > either, but if there is one then Bruce's proposal seems fine.
>
> It is true no one asked for this information except Peter (I assume for
> just academic reasons), and I don't think we care from a bug reporting
> perspective, so I will just keep the patch around in case we ever want it.

I'm sorry for late response, I was offline for last week. Current
Solaris packages use 32/64bit information. See following output:

postgres=# select version();

version
----------------------------------------------------------------------------------------------
PostgreSQL 8.3.5 64-bit on i386-pc-solaris2.11, compiled
by /opt/SUNWspro.40/SS12/bin/cc -Xa

The information about 32/64bit is important, because both versions are
available, but for some reason they not have same features enabled (e.g.
PL/pgPerl is not in 64bit version). These difference are described in
the special man page and users need to easily determine which version is
running.

Zdenek


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: version() output vs. 32/64 bits
Date: 2009-01-05 12:33:17
Message-ID: 1231158797.2497.12.camel@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Alvaro Herrera píše v st 31. 12. 2008 v 12:54 -0300:

> Maybe we could have a separate function which returned the info in
> various columns (OUT params). Maybe it would be useful to normalize the
> info as reported the buildfarm, which right now is a bit ad-hoc.

+1 it sounds good.

Zdenek


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: version() output vs. 32/64 bits
Date: 2009-01-05 15:41:12
Message-ID: 200901051541.n05FfCC26925@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Zdenek Kotala wrote:
>
> Alvaro Herrera p??e v st 31. 12. 2008 v 12:54 -0300:
>
> > Maybe we could have a separate function which returned the info in
> > various columns (OUT params). Maybe it would be useful to normalize the
> > info as reported the buildfarm, which right now is a bit ad-hoc.
>
> +1 it sounds good.

So what do we want to do for 8.4? Add 32/64-bit version() indicator and
add OUT parameters to the TODO list?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: version() output vs. 32/64 bits
Date: 2009-01-05 18:07:55
Message-ID: 23777.1231178875@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> So what do we want to do for 8.4? Add 32/64-bit version() indicator and
> add OUT parameters to the TODO list?

+1. There seems a good case for making the 32/64bit distinction
visible somewhere, and the text version string is as good as anyplace.

I think the business about splitting up the string is mostly
lily-gilding, but if someone wants it enough to do it ...

regards, tom lane


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Magnus Hagander <magnus(at)hagander(dot)net>
Subject: Re: version() output vs. 32/64 bits
Date: 2009-01-06 03:06:47
Message-ID: 200901060306.n0636lU14370@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > So what do we want to do for 8.4? Add 32/64-bit version() indicator and
> > add OUT parameters to the TODO list?
>
> +1. There seems a good case for making the 32/64bit distinction
> visible somewhere, and the text version string is as good as anyplace.

OK, done with the attached patch, and autoconf run. Magnus, would you
add this change to the MSVC build? Thanks.

test=> select version();
version
--------------------------------------------------------------------------

PostgreSQL 8.4devel on i386-pc-bsdi4.3.1, compiled by GCC 2.95.3, 32-bit
(1 row)

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/rtmp/diff text/x-diff 702 bytes

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: version() output vs. 32/64 bits
Date: 2009-01-06 18:38:42
Message-ID: 4963A532.6080306@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian wrote:
> Tom Lane wrote:
>> Bruce Momjian <bruce(at)momjian(dot)us> writes:
>>> So what do we want to do for 8.4? Add 32/64-bit version() indicator and
>>> add OUT parameters to the TODO list?
>> +1. There seems a good case for making the 32/64bit distinction
>> visible somewhere, and the text version string is as good as anyplace.
>
> OK, done with the attached patch, and autoconf run. Magnus, would you
> add this change to the MSVC build? Thanks.
>
> test=> select version();
> version
> --------------------------------------------------------------------------
>
> PostgreSQL 8.4devel on i386-pc-bsdi4.3.1, compiled by GCC 2.95.3, 32-bit
> (1 row)
>
>

Done.

postgres=# select version();
version
----------------------------------------------------------------
PostgreSQL 8.4devel, compiled by Visual C++ build 1400, 32-bit
(1 row)

//Magnus


From: Greg Smith <gsmith(at)gregsmith(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: version() output vs. 32/64 bits
Date: 2009-01-07 06:46:09
Message-ID: Pine.GSO.4.64.0901070126570.8477@westnet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, 31 Dec 2008, Tom Lane wrote:

> No one has asked for access to individual components of the version
> string, other than the PG version number itself, which we already dealt
> with.

I think I'm now up to having wrote something to break apart the output
from version() into individual fields for 3 different companies. If
you're got a bunch of database servers on a network, it seems inevitable
that eventually you'll end up collecting information about them via
queries against port 5432 for managing everything, and the output from
version() always ends up on that hotlist. I'd bet the only reason this
hasn't been a specific TODO request before is because it is relatively
easy (albeit fragile) to parse it out manually.

There are also some use cases related to writing tuning tools, where for
example the platform bit size determines what range some settings can
reach. Again, you can just parse it out if that starts being included,
but it would be cleaner to grab just that one piece. (Right now I just
look at the maximum value for one of the settings I know changes size to
figure that out when this pops up)

--
* Greg Smith gsmith(at)gregsmith(dot)com http://www.gregsmith.com Baltimore, MD


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Greg Smith <gsmith(at)gregsmith(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: version() output vs. 32/64 bits
Date: 2009-01-07 09:45:22
Message-ID: 496479B2.7040001@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Greg Smith wrote:
> I think I'm now up to having wrote something to break apart the output
> from version() into individual fields for 3 different companies. If
> you're got a bunch of database servers on a network, it seems inevitable
> that eventually you'll end up collecting information about them via
> queries against port 5432 for managing everything, and the output from
> version() always ends up on that hotlist.

Good point, but if you want to do reasonable monitoring, don't you also
want information on CPU, disk, etc.? So really, you need shell access
anyway. Plus, my point was the the version output isn't all that
reliable anyway, because it tells you about the build system and build
compiler, not the host system and host compiler (if any). I think it's
tempting but not terribly practical.

> There are also some use cases related to writing tuning tools, where for
> example the platform bit size determines what range some settings can
> reach. Again, you can just parse it out if that starts being included,
> but it would be cleaner to grab just that one piece. (Right now I just
> look at the maximum value for one of the settings I know changes size to
> figure that out when this pops up)

That was one reason why people approached me to raise this subject. But
after consideration, I think it is much better to actually query the
maximum values directly rather than trying to reverse engineer them from
platform information.