EPUB | CHM | PDF

TPSQLRestore.Properties.VersionAsInt

Top Previous Next

Returns an integer representing the pg_restore.dll version.

Syntax:

property VersionAsInt: integer;

Description:

Applications may use this readonly property to determine the version of the pg_restore.dll library will be used by TPSQLRestore object. 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 library can not be found.

Example:

This example checks if server version is higher then restore library and if so version check is disabled:

procedure TForm1.Button2Click(Sender: TObject);
begin
  If PSQLDatabase1.ServerVersionAsInt > PSQLRestore.VersionAsInt then
   PSQLRestore.Options := PSQLRestore.Options + [roIgnoreVersion];
end;