Re: [GENERAL] Backward compatibility

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: [GENERAL] Backward compatibility
Дата
Msg-id 989d629b-0b34-6e76-430a-1d3d72a2a203@hogranch.com
обсуждение исходный текст
Ответ на Re: [GENERAL] Backward compatibility  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: [GENERAL] Backward compatibility
Список pgsql-general
On 7/20/2017 7:57 PM, David G. Johnston wrote:

Actually, The docs do cover how to do this directly in libpq.

odds are pretty good that...

PQserverVersion










Returns an integer representing the backend version.

int PQserverVersion(const PGconn *conn);

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.


Actually invokes `show server_version_num;'



-- 
john r pierce, recycling bits in santa cruz

В списке pgsql-general по дате отправления:

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: [GENERAL] Backward compatibility
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] Backward compatibility