GetClientVersion for PostgreSQL

Code samples and contributions from users for ZeosLib's DBOs of version 6.x

Moderators: gto, cipto_kh, EgonHugeist, mdaems

Post Reply
rayanAyar
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 02.07.2010, 04:26

GetClientVersion for PostgreSQL

Post by rayanAyar »

Draft patch "GetClientVersion for PostgreSQL".
Function gives version of client library.
Tested on git branch "8.0-patches".
You do not have the required permissions to view the files attached to this post.
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 765
Joined: 18.11.2018, 17:37
Location: Hungary

Re: GetClientVersion for PostgreSQL

Post 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?
Delphi 12.1, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmariadb.dll 3.3.8
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.13
- MSSQL 2012, 2019; sybdb.dll FreeTDS_2435
- SQLite 3.45.2
rayanAyar
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 02.07.2010, 04:26

Re: GetClientVersion for PostgreSQL

Post by rayanAyar »

aehimself wrote: 20.05.2023, 18:41 You are using C builder, correct?
Lazarus. Linux.
miab3
Zeos Test Team
Zeos Test Team
Posts: 1309
Joined: 11.05.2012, 12:32
Location: Poland

Re: GetClientVersion for PostgreSQL

Post by miab3 »

Lazarus(Pascal) allows it, but for portability it's worth changing to result := result+ ...

Michal
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1918
Joined: 17.01.2011, 14:17

Re: GetClientVersion for PostgreSQL

Post by marsupilami »

I applied the patch. Thank you for the contribution. :)
Post Reply