mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
PostgreSQL: Make TPGConnection.FetchDbObjects compatible to pre-9.0 servers. See http://www.heidisql.com/forum.php?t=16996
This commit is contained in:
@ -4218,7 +4218,7 @@ procedure TPGConnection.FetchDbObjects(db: String; var Cache: TDBObjectList);
|
||||
var
|
||||
obj: TDBObject;
|
||||
Results: TDBQuery;
|
||||
tp, SchemaTable: String;
|
||||
tp, SchemaTable, SizeClause: String;
|
||||
begin
|
||||
// Tables, views and procedures
|
||||
Results := nil;
|
||||
@ -4228,8 +4228,13 @@ begin
|
||||
SchemaTable := 'QUOTE_IDENT(t.TABLE_SCHEMA) || '+EscapeString('.')+' || QUOTE_IDENT(t.TABLE_NAME)'
|
||||
else
|
||||
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+')'
|
||||
else
|
||||
SizeClause := 'NULL';
|
||||
Results := GetResults('SELECT *,'+
|
||||
' pg_table_size('+SchemaTable+') AS data_length,'+
|
||||
' '+SizeClause+' AS data_length,'+
|
||||
' pg_relation_size('+SchemaTable+') AS index_length,'+
|
||||
' c.reltuples, obj_description(c.oid) AS comment'+
|
||||
' FROM '+QuoteIdent('information_schema')+'.'+QuoteIdent('tables')+' AS t'+
|
||||
|
Reference in New Issue
Block a user