PostgresDAC
TPSQLDatabase.Properties.ServerVersionAsInt | Previous Next |
Returns an integer representing the backend version.
Syntax:
property ServerVersionAsInt: integer;
Description:
Applications may use this readonly property 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 zeros are not shown). Zero value is returned if
the connection is failed.
Example:
This example checks if server supports tablespaces:
procedure TForm1.Button2Click(Sender: TObject);
begin
If PSQLDatabase1.ServerVersionAsInt >= 080000 then // v.8.0.0 or greater
ShowMessage('Tablespaces supported')
else
ShowMessage('Tablespaces not supported');
end;