dbTalk Databases Forums  

[BUGS] BUG #2701: PQserverVersion function missing

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2701: PQserverVersion function missing in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Seth Gordon
 
Posts: n/a

Default [BUGS] BUG #2701: PQserverVersion function missing - 10-17-2006 , 10:18 AM







The following bug has been logged online:

Bug reference: 2701
Logged by: Seth Gordon
Email address: sethg+pg (AT) ropine (DOT) com
PostgreSQL version: 7.4.7
Operating system: Linux (Debian stable)
Description: PQserverVersion function missing
Details:

The 8.0/8.1 documentation for libpq says the following about
PQserverVersion:

"Applications may use this to determine the version of the database server
they are connected to. The number is formed by converting the major, minor,
and revision numbers into two-decimal-digit numbers and appending them
together. For example, version 7.4.2 will be returned as 70402, and version
8.1 will be returned as 80100 (leading zeroes are not shown). Zero is
returned if the connection is bad."

But libpq for 7.4.7 does not have this function. So this is either a bug in
the 7.4 code or a bug in the 8.1 documentation.

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly

Reply With Quote
  #2  
Old   
Bruce Momjian
 
Posts: n/a

Default Re: [BUGS] BUG #2701: PQserverVersion function missing - 10-21-2006 , 02:41 PM






Seth Gordon wrote:
Quote:
The following bug has been logged online:

Bug reference: 2701
Logged by: Seth Gordon
Email address: sethg+pg (AT) ropine (DOT) com
PostgreSQL version: 7.4.7
Operating system: Linux (Debian stable)
Description: PQserverVersion function missing
Details:

The 8.0/8.1 documentation for libpq says the following about
PQserverVersion:

"Applications may use this to determine the version of the database server
they are connected to. The number is formed by converting the major, minor,
and revision numbers into two-decimal-digit numbers and appending them
together. For example, version 7.4.2 will be returned as 70402, and version
8.1 will be returned as 80100 (leading zeroes are not shown). Zero is
returned if the connection is bad."

But libpq for 7.4.7 does not have this function. So this is either a bug in
the 7.4 code or a bug in the 8.1 documentation.
Good point. I changed the example to use 8.1.X:

For example, version 8.1.5 will be returned as 80105, and version
8.1 will be returned as 80100 (leading zeroes are not shown). Zero is
returned if the connection is bad.

Actually, the 8.0.X libpq function would still report 70401 if connected
to a 7.4.1 database, but it seems best to use a newer release number as
an example.

(Historically, 7.4.X was chosen as an example because at the time the
function was added in 8.0, we didn't know a valid 8.0.X minor version
number.)

--
Bruce Momjian bruce (AT) momjian (DOT) us
EnterpriseDB http://www.enterprisedb.com

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

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


Reply With Quote
  #3  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #2701: PQserverVersion function missing - 10-21-2006 , 05:37 PM



Bruce Momjian <bruce (AT) momjian (DOT) us> writes:
Quote:
Actually, the 8.0.X libpq function would still report 70401 if connected
to a 7.4.1 database,
That was exactly the reason why the docs were written like that. Using
two examples that are both from the same major release doesn't seem to
me to be an improvement.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


Reply With Quote
  #4  
Old   
Bruce Momjian
 
Posts: n/a

Default Re: [BUGS] BUG #2701: PQserverVersion function missing - 10-23-2006 , 09:40 PM



Tom Lane wrote:
Quote:
Bruce Momjian <bruce (AT) momjian (DOT) us> writes:
Actually, the 8.0.X libpq function would still report 70401 if connected
to a 7.4.1 database,

That was exactly the reason why the docs were written like that. Using
two examples that are both from the same major release doesn't seem to
me to be an improvement.
Actually, the problem with 8.0.X is that the major version number had a
zero in it. 8.1 does not, so I think it is actually better to use the
same major version number in both examples. The second example is to
highlight that 8.1 has a trailing "00".

--
Bruce Momjian bruce (AT) momjian (DOT) us
EnterpriseDB http://www.enterprisedb.com

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

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


Reply With Quote
  #5  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #2701: PQserverVersion function missing - 10-23-2006 , 11:30 PM



Bruce Momjian <bruce (AT) momjian (DOT) us> writes:
Quote:
Tom Lane wrote:
Bruce Momjian <bruce (AT) momjian (DOT) us> writes:
Actually, the 8.0.X libpq function would still report 70401 if connected
to a 7.4.1 database,

That was exactly the reason why the docs were written like that. Using
two examples that are both from the same major release doesn't seem to
me to be an improvement.

Actually, the problem with 8.0.X is that the major version number had a
zero in it. 8.1 does not, so I think it is actually better to use the
same major version number in both examples.
You're ignoring the point at hand, which is exactly that the libpq
function will work when connected to servers older (in fact much older)
than it is.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


Reply With Quote
  #6  
Old   
Bruce Momjian
 
Posts: n/a

Default Re: [BUGS] BUG #2701: PQserverVersion function missing - 10-24-2006 , 04:12 PM



Tom Lane wrote:
Quote:
Bruce Momjian <bruce (AT) momjian (DOT) us> writes:
Tom Lane wrote:
Bruce Momjian <bruce (AT) momjian (DOT) us> writes:
Actually, the 8.0.X libpq function would still report 70401 if connected
to a 7.4.1 database,

That was exactly the reason why the docs were written like that. Using
two examples that are both from the same major release doesn't seem to
me to be an improvement.

Actually, the problem with 8.0.X is that the major version number had a
zero in it. 8.1 does not, so I think it is actually better to use the
same major version number in both examples.

You're ignoring the point at hand, which is exactly that the libpq
function will work when connected to servers older (in fact much older)
than it is.
Fine, but the examples are not trying to show that. The example is to
show the trailing zero added for 8.1.

--
Bruce Momjian bruce (AT) momjian (DOT) us
EnterpriseDB http://www.enterprisedb.com

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

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.