From 900e0dd119d32a98fb6dea82bc33ce1b7935bc07 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Wed, 20 May 2020 12:12:02 +0200 Subject: [PATCH] Cast relpages to bigint, preventing out-of-range SQL error in PostgreSQL. Closes #1038 --- source/dbconnection.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dbconnection.pas b/source/dbconnection.pas index bb8fc5d6..79ac7b07 100644 --- a/source/dbconnection.pas +++ b/source/dbconnection.pas @@ -6049,7 +6049,7 @@ begin if Parameters.FullTableStatus and (ServerVersionInt >= 80100) then IndexLenClause := 'pg_relation_size('+SchemaTable+')::bigint' else - IndexLenClause := 'relpages * '+SIZE_KB.ToString; + IndexLenClause := 'relpages::bigint * '+SIZE_KB.ToString; Results := GetResults('SELECT *,'+ ' '+DataLenClause+' AS data_length,'+ ' '+IndexLenClause+' AS index_length,'+