pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedDeterming Postgres version
5+ messages / 3 participants
[nested] [flat]
* Determing Postgres version
@ 2001-12-17 06:23 Gary Hoffman <ghoffman@ucsd.edu>
2001-12-17 07:01 ` Re: Determing Postgres version Christopher Kings-Lynne <chriskl@familyhealth.com.au>
0 siblings, 1 reply; 5+ messages in thread
From: Gary Hoffman @ 2001-12-17 06:23 UTC (permalink / raw)
To: pgsql-php
For an off-campus project, my web hosting ISP has the PostgreSQL
postmaster running on a host separate from where my web pages are hosted.
My queries work OK, but I can't get LIMIT to work. I suspect he hasn't
upgraded to version 7 yet. How can I query for a version? I can't use
pg_config --version because it's not on my local host and anyway it
wouldn't find the postmaster on this host.
Can I use a SQL query to determine the version of the postmaster?
Thanks in advance.
Gary
**************************************************************************
* Gary B. Hoffman, Computing Services Manager e-mail: ghoffman@ucsd.edu *
* Graduate School of International Relations and Pacific Studies (IR/PS) *
* University of California, San Diego (UCSD) voice: (858) 534-1989 *
* 9500 Gilman Dr. MC 0519 fax: (858) 534-3939 *
* La Jolla, CA 92093-0519 USA web: http://www-irps.ucsd.edu/ *
**************************************************************************
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Determing Postgres version
2001-12-17 06:23 Determing Postgres version Gary Hoffman <ghoffman@ucsd.edu>
@ 2001-12-17 07:01 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
2001-12-17 16:16 ` Re: Determing Postgres version Gary Hoffman <ghoffman@ucsd.edu>
0 siblings, 1 reply; 5+ messages in thread
From: Christopher Kings-Lynne @ 2001-12-17 07:01 UTC (permalink / raw)
To: Gary Hoffman <ghoffman@ucsd.edu>; pgsql-php
Try:
select version();
Chirs
> -----Original Message-----
> From: pgsql-php-owner@postgresql.org
> [mailto:pgsql-php-owner@postgresql.org]On Behalf Of Gary Hoffman
> Sent: Monday, 17 December 2001 2:24 PM
> To: pgsql-php@postgresql.org
> Subject: [PHP] Determing Postgres version
>
>
> For an off-campus project, my web hosting ISP has the PostgreSQL
> postmaster running on a host separate from where my web pages are hosted.
> My queries work OK, but I can't get LIMIT to work. I suspect he hasn't
> upgraded to version 7 yet. How can I query for a version? I can't use
> pg_config --version because it's not on my local host and anyway it
> wouldn't find the postmaster on this host.
>
> Can I use a SQL query to determine the version of the postmaster?
>
> Thanks in advance.
> Gary
>
> **************************************************************************
> * Gary B. Hoffman, Computing Services Manager e-mail: ghoffman@ucsd.edu *
> * Graduate School of International Relations and Pacific Studies (IR/PS) *
> * University of California, San Diego (UCSD) voice: (858) 534-1989 *
> * 9500 Gilman Dr. MC 0519 fax: (858) 534-3939 *
> * La Jolla, CA 92093-0519 USA web: http://www-irps.ucsd.edu/ *
> **************************************************************************
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Determing Postgres version
2001-12-17 06:23 Determing Postgres version Gary Hoffman <ghoffman@ucsd.edu>
2001-12-17 07:01 ` Re: Determing Postgres version Christopher Kings-Lynne <chriskl@familyhealth.com.au>
@ 2001-12-17 16:16 ` Gary Hoffman <ghoffman@ucsd.edu>
2001-12-17 18:03 ` Re: Determing Postgres version Vince Vielhaber <vev@michvhf.com>
2001-12-18 01:39 ` Re: Determing Postgres version Christopher Kings-Lynne <chriskl@familyhealth.com.au>
0 siblings, 2 replies; 5+ messages in thread
From: Gary Hoffman @ 2001-12-17 16:16 UTC (permalink / raw)
To: chriskl@familyhealth.com.au; +Cc: pgsql-php
Well, I thought of that.
Here's what I get:
ERROR: function version() does not exist
Any other ideas, short of actually asking the ISP help desk?
Gary
chriskl@familyhealth.com.au writes:
>Try:
>
>select version();
>
>Chirs
>
>> -----Original Message-----
>> From: pgsql-php-owner@postgresql.org
>> [mailto:pgsql-php-owner@postgresql.org]On Behalf Of Gary Hoffman
>> Sent: Monday, 17 December 2001 2:24 PM
>> To: pgsql-php@postgresql.org
>> Subject: [PHP] Determing Postgres version
>>
>>
>> For an off-campus project, my web hosting ISP has the PostgreSQL
>> postmaster running on a host separate from where my web pages are
>hosted.
>> My queries work OK, but I can't get LIMIT to work. I suspect he hasn't
>> upgraded to version 7 yet. How can I query for a version? I can't use
>> pg_config --version because it's not on my local host and anyway it
>> wouldn't find the postmaster on this host.
>>
>> Can I use a SQL query to determine the version of the postmaster?
>>
>> Thanks in advance.
>> Gary
**************************************************************************
* Gary B. Hoffman, Computing Services Manager e-mail: ghoffman@ucsd.edu *
* Graduate School of International Relations and Pacific Studies (IR/PS) *
* University of California, San Diego (UCSD) voice: (858) 534-1989 *
* 9500 Gilman Dr. MC 0519 fax: (858) 534-3939 *
* La Jolla, CA 92093-0519 USA web: http://www-irps.ucsd.edu/ *
**************************************************************************
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Determing Postgres version
2001-12-17 06:23 Determing Postgres version Gary Hoffman <ghoffman@ucsd.edu>
2001-12-17 07:01 ` Re: Determing Postgres version Christopher Kings-Lynne <chriskl@familyhealth.com.au>
2001-12-17 16:16 ` Re: Determing Postgres version Gary Hoffman <ghoffman@ucsd.edu>
@ 2001-12-17 18:03 ` Vince Vielhaber <vev@michvhf.com>
1 sibling, 0 replies; 5+ messages in thread
From: Vince Vielhaber @ 2001-12-17 18:03 UTC (permalink / raw)
To: Gary Hoffman <ghoffman@ucsd.edu>; +Cc: pgsql-php
On Mon, 17 Dec 2001, Gary Hoffman wrote:
> Well, I thought of that.
>
> Here's what I get:
> ERROR: function version() does not exist
>
> Any other ideas, short of actually asking the ISP help desk?
I just did it and it worked fine:
$query = "select version()";
$res = pg_exec($conn,$query);
if(!$res) {
die("not found");
}
if(($x = pg_numrows($res)) < 1) {
echo("not found in database\n");
exit;
}
$row = pg_fetch_row($res,$ii);
echo("version: $row[0]");
and it gives:
version: PostgreSQL 7.1.2 on i386-unknown-freebsd4.2, compiled by GCC 2.95.2
Maybe it's really old?
Vince.
--
==========================================================================
Vince Vielhaber -- KA8CSH email: vev@michvhf.com http://www.pop4.net
56K Nationwide Dialup from $16.00/mo at Pop4 Networking
Online Campground Directory http://www.camping-usa.com
Online Giftshop Superstore http://www.cloudninegifts.com
==========================================================================
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Determing Postgres version
2001-12-17 06:23 Determing Postgres version Gary Hoffman <ghoffman@ucsd.edu>
2001-12-17 07:01 ` Re: Determing Postgres version Christopher Kings-Lynne <chriskl@familyhealth.com.au>
2001-12-17 16:16 ` Re: Determing Postgres version Gary Hoffman <ghoffman@ucsd.edu>
@ 2001-12-18 01:39 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
1 sibling, 0 replies; 5+ messages in thread
From: Christopher Kings-Lynne @ 2001-12-18 01:39 UTC (permalink / raw)
To: Gary Hoffman <ghoffman@ucsd.edu>; +Cc: pgsql-php
> -----Original Message-----
> From: Gary Hoffman [mailto:ghoffman@ucsd.edu]
> Sent: Tuesday, 18 December 2001 12:16 AM
> To: chriskl@familyhealth.com.au
> Cc: pgsql-php@postgresql.org
> Subject: Re: RE: [PHP] Determing Postgres version
>
>
> Well, I thought of that.
>
> Here's what I get:
> ERROR: function version() does not exist
>
> Any other ideas, short of actually asking the ISP help desk?
Not really - bit before my time!
Another thought - if the old version of postgres doesn't support LIMIT, does
it support CURSORs? If it does, you can simulate LIMIT by going:
BEGIN;
DECLARE mycursor CURSOR
FOR SELECT * FROM table;
FETCH FORWARD limit_no IN mycursor;
CLOSE mycursor;
COMMIT;
Chris
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2001-12-18 01:39 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-12-17 06:23 Determing Postgres version Gary Hoffman <ghoffman@ucsd.edu>
2001-12-17 07:01 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
2001-12-17 16:16 ` Gary Hoffman <ghoffman@ucsd.edu>
2001-12-17 18:03 ` Vince Vielhaber <vev@michvhf.com>
2001-12-18 01:39 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox