By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,776 Members | 1,777 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,776 IT Pros & Developers. It's quick & easy.

What Version Installed?

P: n/a
Hi All,
How can I determine what version of postgresql is installed. Can't find
answer in archives.
thanks,
Phil
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 22 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hi:

El jue, 15-01-2004 a las 16:56, Phil Campaigne escribió:
Hi All,
How can I determine what version of postgresql is installed. Can't find
answer in archives.
thanks,

SELECT version();
--
Saludos

Roberto Andrade Fonseca
Microsoft Certified Solitaire Player
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 22 '05 #2

P: n/a
Roberto Andrade Fonseca wrote:
El jue, 15-01-2004 a las 16:56, Phil Campaigne escribió:
Hi All,
How can I determine what version of postgresql is installed.


SELECT version();


What's the function or purpose of the file "PG_VERSION" in $PGDATADIR?

In my case, /var/lib/postgres/data/PG_VERSION contains "7.3"

Is this the version of PostgreSQL that created the database?

Alex Satrapa
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 22 '05 #3

P: n/a
pc********@charter.net (Phil Campaigne) writes:
How can I determine what version of postgresql is installed. Can't
find answer in archives.


How to determine the version is well documented here...
<http://www.postgresql.org/docs/current/interactive/functions-misc.html>
--
let name="cbbrowne" and tld="libertyrms.info" in String.concat "@" [name;tld];;
<http://dev6.int.libertyrms.com/>
Christopher Browne
(416) 646 3304 x124 (land)
Nov 22 '05 #4

P: n/a
There are several answers to this.

If you use a package manager like rpm (e.g., RedHat, SuSE, Mandrake),
try:

tallac$ rpm -q postgresql
postgresql-7.3.4-3.rhl9

Most (all?) binaries take a the standard-ish --version flag, like this:

tallac$ initdb --version
initdb (PostgreSQL) 7.4.1
tallac$ postmaster --version
postmaster (PostgreSQL) 7.4.1

You'll notice that I've got two versions installed, so be careful about
knowing which ones you're actually using. (BTW, I don't usually have two
versions installed and doing so probably isn't a good idea for most
people, but I happened to need 7.3.4's psql client briefly.)

Finally, you can ask the server you're talking to:

tallac$ psql -UPUBLIC -c 'select version()'
version
-------------------------------------------------------------
PostgreSQL 7.4.1 on i686-pc-linux-gnu, compiled by GCC 2.96
-Reece
--
Reece Hart, Ph.D. rk*@gene.com, http://www.gene.com/
Genentech, Inc. 650/225-6133 (voice), -5389 (fax)
Bioinformatics and Protein Engineering
1 DNA Way, MS-93 http://www.in-machina.com/~reece/
South San Francisco, CA 94080-4990 re***@in-machina.com, GPG: 0x25EC91A0

Nov 22 '05 #5

P: n/a
That's the file the backend uses to determine whether the directory it's
looking at is:

a) an initdb'd location
b) initdb'd with the right version

It bears no relation to your actual installed binaries though.

On Fri, Jan 16, 2004 at 10:32:24AM +1100, Alex Satrapa wrote:
Roberto Andrade Fonseca wrote:
El jue, 15-01-2004 a las 16:56, Phil Campaigne escribió:
Hi All,
How can I determine what version of postgresql is installed.
SELECT version();


What's the function or purpose of the file "PG_VERSION" in $PGDATADIR?

In my case, /var/lib/postgres/data/PG_VERSION contains "7.3"

Is this the version of PostgreSQL that created the database?

Alex Satrapa


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


--
Martijn van Oosterhout <kl*****@svana.org> http://svana.org/kleptog/ (... have gone from d-i being barely usable even by its developers
anywhere, to being about 20% done. Sweet. And the last 80% usually takes
20% of the time, too, right?) -- Anthony Towns, debian-devel-announce


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQFAB3FLY5Twig3Ge+YRAhaVAJ9iowkY99oSGg4BlX0mfz Yo5xslNgCfdJko
PhISr4e5QpAYMLlLqgTUS08=
=pkHs
-----END PGP SIGNATURE-----

Nov 22 '05 #6

P: n/a
There are several answers to this.

If you use a package manager like rpm (e.g., RedHat, SuSE, Mandrake),
try:

tallac$ rpm -q postgresql
postgresql-7.3.4-3.rhl9

Most (all?) binaries take a the standard-ish --version flag, like this:

tallac$ initdb --version
initdb (PostgreSQL) 7.4.1
tallac$ postmaster --version
postmaster (PostgreSQL) 7.4.1

You'll notice that I've got two versions installed, so be careful about
knowing which ones you're actually using. (BTW, I don't usually have two
versions installed and doing so probably isn't a good idea for most
people, but I happened to need 7.3.4's psql client briefly.)

Finally, you can ask the server you're talking to:

tallac$ psql -UPUBLIC -c 'select version()'
version
-------------------------------------------------------------
PostgreSQL 7.4.1 on i686-pc-linux-gnu, compiled by GCC 2.96
-Reece
--
Reece Hart, Ph.D. rk*@gene.com, http://www.gene.com/
Genentech, Inc. 650/225-6133 (voice), -5389 (fax)
Bioinformatics and Protein Engineering
1 DNA Way, MS-93 http://www.in-machina.com/~reece/
South San Francisco, CA 94080-4990 re***@in-machina.com, GPG: 0x25EC91A0

Nov 22 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.