From b52965097bd76b62c5b15e342bc3554470f376b7 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Wed, 25 Mar 2015 18:50:52 +0000 Subject: [PATCH] PostgreSQL: Cast result of pg_table_size() and pg_relation_size() to bigint, so size bars are displayed correctly. See http://www.heidisql.com/forum.php?t=17959 --- source/dbconnection.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dbconnection.pas b/source/dbconnection.pas index ab7d56e0..20e138b9 100644 --- a/source/dbconnection.pas +++ b/source/dbconnection.pas @@ -4227,12 +4227,12 @@ begin SchemaTable := EscapeString(FQuoteChar)+' || t.TABLE_SCHEMA || '+EscapeString(FQuoteChar+'.'+FQuoteChar)+' || t.TABLE_NAME || '+EscapeString(FQuoteChar); // See http://www.heidisql.com/forum.php?t=16996 if ServerVersionInt >= 90000 then - SizeClause := 'pg_table_size('+SchemaTable+')' + SizeClause := 'pg_table_size('+SchemaTable+')::bigint' else SizeClause := 'NULL'; Results := GetResults('SELECT *,'+ ' '+SizeClause+' AS data_length,'+ - ' pg_relation_size('+SchemaTable+') AS index_length,'+ + ' pg_relation_size('+SchemaTable+')::bigint AS index_length,'+ ' c.reltuples, obj_description(c.oid) AS comment'+ ' FROM '+QuoteIdent('information_schema')+'.'+QuoteIdent('tables')+' AS t'+ ' LEFT JOIN '+QuoteIdent('pg_namespace')+' n ON t.table_schema = n.nspname'+