Re: How to tell what OS PostgreSQL is installed on.

Поиск
Список
Период
Сортировка
От Scott Whitney
Тема Re: How to tell what OS PostgreSQL is installed on.
Дата
Msg-id 20091008214940.34BF0DC003@mail.int.journyx.com
обсуждение исходный текст
Ответ на Re: How to tell what OS PostgreSQL is installed on.  ("Scott Whitney" <swhitney@journyx.com>)
Ответы Re: How to tell what OS PostgreSQL is installed on.
Re: How to tell what OS PostgreSQL is installed on.
Список pgsql-admin
One more clever one:

\o /tmp/foo will fail on Windows with a "No such file or directory"

Any Unix system will give you access to /tmp for writing. If you can't open
a stream for output to /tmp, you're on a file system that has no /tmp, aka
Windows

-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Scott Whitney
Sent: Thursday, October 08, 2009 4:11 PM
To: 'Louis Lam'; pgsql-admin@postgresql.org
Subject: Re: [ADMIN] How to tell what OS PostgreSQL is installed on.

Visual C++ is Microsoft's compiler for C++. If something is compiled with
Visual C++, it was COMPILED on Windows. There is a 99.9% chance that the
underlying machine is also Windows (unless you're talking about a VM, but,
still, the OS on which PG itself is running is, in fact, Windows).

To the best of my knowledge, there is no way, within the PG interpreter to
determine what version of Windows you're on, however.



-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Louis Lam
Sent: Thursday, October 08, 2009 3:59 PM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] How to tell what OS PostgreSQL is installed on.

Hi,



I have a need to find out what OS PostgreSQL is running under.  I need to be
able to query the database or send a command and  figure it out.  I also do
not have super user permission to do this.  All I want to know is if the
PostgreSQL I am connected to is running from Windows or Non Windows.



I could do "Show data_directory" and parse the result, but this require
superuser permission.



I tried select version() also.  Under Windows OS, I got this:



version

 ---------------------------------------------------

 PostgreSQL 8.3.6, compiled by Visual C++ build 1400



Does anyone know if Visual C++ is use to only compile PostgreSQL for
Windows?  Or can other compiler be use?  If Visual C++ is always use for
Windows and Windows only then this is very good information I can use.



I know on RedHat, I got this.



version



----------------------------------------------------------------------------
--------------------------

 PostgreSQL 8.3.7 on i686-redhat-linux-gnu, compiled by GCC gcc (GCC) 3.4.6
20060404 (Red Hat 3.4.6-10)



And on Solaris I got this.



-----------------

 PostgreSQL 8.1.11 on sparc-sun-solaris2.10, compiled by
/ws/on10-tools/SUNWspro/SOS8/bin/cc -Xa

(1 row)





Thank you all in advance for your help.

Louis Lam





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


В списке pgsql-admin по дате отправления:

Предыдущее
От: Louis Lam
Дата:
Сообщение: Re: How to tell what OS PostgreSQL is installed on.
Следующее
От: Louis Lam
Дата:
Сообщение: Re: How to tell what OS PostgreSQL is installed on.