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

From: Louis Lam <louis(dot)lam(at)guardium(dot)com>
To: Scott Whitney <swhitney(at)journyx(dot)com>, Julio Leyva <jcleyva(at)hotmail(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: How to tell what OS PostgreSQL is installed on.
Date: 2009-10-08 21:31:50
Message-ID: -2320685469093100846@unknownmsgid
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Scott,

Thanks for the info. I did tried

select pg_show_all_settings()

But this function has a filter based on a user privilege. As postgres
user, I got 187 rows return and can see parameter like data_directory with
its OS path. But as a non admin user, I got 176 rows return and all the
parameters that would point to a directory on the OS are not shown due to
privilege.

Louis.

-----Original Message-----
From: Scott Whitney [mailto:swhitney(at)journyx(dot)com]
Sent: Thursday, October 08, 2009 5:19 PM
To: 'Julio Leyva'; louis(dot)lam(at)guardium(dot)com; pgsql-admin(at)postgresql(dot)org
Subject: RE: [ADMIN] How to tell what OS PostgreSQL is installed on.

Another option might be to look in the
select pg_show_all_settings() for the ident_file.

If the ident file is a DOS path (aka c:\somewhere\some dir\some file), you
know you're on a Windows-based system. If it's a UNIX path, select
version()
will tell you specifically.

-----Original Message-----
From: pgsql-admin-owner(at)postgresql(dot)org
[mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of Julio Leyva
Sent: Thursday, October 08, 2009 4:14 PM
To: louis(dot)lam(at)guardium(dot)com; pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] How to tell what OS PostgreSQL is installed on.

as postgres user

psql -c "select version()";

________________________________

From: louis(dot)lam(at)guardium(dot)com
Date: Thu, 8 Oct 2009 16:58:33 -0400
Subject: [ADMIN] How to tell what OS PostgreSQL is installed on.
To: pgsql-admin(at)postgresql(dot)org

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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Whitney 2009-10-08 21:49:40 Re: How to tell what OS PostgreSQL is installed on.
Previous Message Scott Whitney 2009-10-08 21:19:07 Re: How to tell what OS PostgreSQL is installed on.