zDbcProgresql.pas send too many queries like that : select pc.relname, pns.nspname, pa.attnum.......
we could improve like that :
function TZPGTableInfoCache.GetTableInfo(const TblOid: Oid;
CurrentFieldCount: Integer): PZPGTableInfo;
var Idx: Integer;
begin
Idx := GetTblPos(TblOid);
if (Idx = -1) then
if (TblOid <> InvalidOid) and (LoadTblInfo(TblOid, Idx, nil)) then
Result := @FTblInfo[Idx]
else
Result := nil
else
begin
Result := @FTblInfo[Idx];
// !!NR le 20.10.2015
// Nothing change If Query Or Table Fields Count <> From TblInfo.FieldCount
//if Result^.ColCount <> CurrentFieldCount then //something changed ? // LoadTblInfo(TblOid, Idx, Result); //refresh all data
end;
end;
Best regards.
Rolland N.
Related to https://sourceforge.net/p/zeoslib/tickets/120/
Detailed info and solution written in Ticket#120