Page 1 of 1

GetClientVersion for PostgreSQL

Posted: 18.05.2023, 17:22
by rayanAyar
Draft patch "GetClientVersion for PostgreSQL".
Function gives version of client library.
Tested on git branch "8.0-patches".

Re: GetClientVersion for PostgreSQL

Posted: 20.05.2023, 18:41
by aehimself
Good one, thanks!

Just keep in mind that Delphi does not support this format:
Result += (pqver mod 100) * 1000;
it should look like
Result := Result + (pqver mod 100) * 1000;
You are using C builder, correct?

Re: GetClientVersion for PostgreSQL

Posted: 21.05.2023, 03:32
by rayanAyar
aehimself wrote: 20.05.2023, 18:41 You are using C builder, correct?
Lazarus. Linux.

Re: GetClientVersion for PostgreSQL

Posted: 21.05.2023, 11:24
by miab3
Lazarus(Pascal) allows it, but for portability it's worth changing to result := result+ ...

Michal

Re: GetClientVersion for PostgreSQL

Posted: 23.05.2023, 10:42
by marsupilami
I applied the patch. Thank you for the contribution. :)