Re: Backward compatibility

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Backward compatibility
Date: 2017-07-21 03:40:06
Message-ID: 478.1500608406@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

John R Pierce <pierce(at)hogranch(dot)com> writes:
> odds are pretty good that...
> |PQserverVersion|
> Returns an integer representing the backend version.
> int PQserverVersion(const PGconn *conn);

> Actually invokes `show server_version_num;'

Just for the record, it doesn't invoke that; it doesn't have to, because
the server sends that info at connection start and libpq just saves it.
But either way should always give the same answer.

> Applications might use this function 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 8.1.5 will be returned as 80105, and version 8.2 will be
> returned as 80200 (leading zeroes are not shown). Zero is returned
> if the connection is bad.

Hm, we need to update that text for the new 2-part version numbering
scheme, don't we?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2017-07-21 03:46:37 Re: Backward compatibility
Previous Message John R Pierce 2017-07-21 03:15:13 Re: Backward compatibility