This commit is contained in:
lsv 2020-09-03 09:45:24 +05:00
parent 1b07916b05
commit 02a9793eb3
4 changed files with 12 additions and 6 deletions

View file

@ -293,7 +293,7 @@ void ctlSQLGrid::AppendColumnHeader(wxString &str, wxArrayInt columns)
bool CopyQuoting = (settings->GetCopyQuoting() == 1 || settings->GetCopyQuoting() == 2);
size_t i;
wxString fielddelim = ",";
if (generatesql == 3) fielddelim = " And ";
if (generatesql == 3) return;
if (generatesql == 1) return;
for(i = 0; i < columns.Count() ; i++)
{

View file

@ -224,7 +224,10 @@ frmStatus::frmStatus(frmMain *form, const wxString &_title, pgConn *conn) : pgFr
}
//pg_is_in_recovery()
wxString v = connection->ExecuteScalar(wxT("select pg_is_in_recovery()"));
isrecovery = (v == wxT("t"));
v = connection->ExecuteScalar(wxT("select current_setting('track_commit_timestamp')"));
track_commit_timestamp = (v == wxT("on"));
delete user;
}
@ -1654,7 +1657,10 @@ void frmStatus::OnRefreshStatusTimer(wxTimerEvent &event)
if (connection->BackendMinimumVersion(10, 0))
{
q += wxT(",backend_type,wait_event_type,wait_event,v.heap_blks_total,v.heap_blks_vacuumed,v.heap_blks_scanned,v.phase\n");
if (isrecovery)
wxString xact = "";
if (!track_commit_timestamp)
q += wxT(",coalesce(sl.xmin,sl.catalog_xmin)::text xmin_slot,':'||slot_name||'['||sl.slot_type||']' slotinfo,'LagSent:'||pg_size_pretty(pg_wal_lsn_diff(pg_last_wal_receive_lsn(),coalesce(confirmed_flush_lsn,restart_lsn)))||' LagXmin: -1'||' s' xminlag,-1 xminslotdelta\n");
else if (isrecovery)
q += wxT(",coalesce(sl.xmin,sl.catalog_xmin)::text xmin_slot,':'||slot_name||'['||sl.slot_type||']' slotinfo,'LagSent:'||pg_size_pretty(pg_wal_lsn_diff(pg_last_wal_receive_lsn(),coalesce(confirmed_flush_lsn,restart_lsn)))||' LagXmin: '||coalesce(extract(epoch from (pg_last_committed_xact()).timestamp - pg_xact_commit_timestamp(xmin))::int,0)||' s' xminlag,coalesce(extract(epoch from (pg_last_committed_xact()).timestamp - pg_xact_commit_timestamp(xmin))::int,0) xminslotdelta\n");
else
q += wxT(",coalesce(sl.xmin,sl.catalog_xmin)::text xmin_slot,':'||slot_name||'['||sl.slot_type||']' slotinfo,'LagSent:'||pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(),coalesce(confirmed_flush_lsn,restart_lsn)))||' LagXmin: '||coalesce(extract(epoch from (pg_last_committed_xact()).timestamp - pg_xact_commit_timestamp(xmin))::int,0)||' s' xminlag,coalesce(extract(epoch from (pg_last_committed_xact()).timestamp - pg_xact_commit_timestamp(xmin))::int,0) xminslotdelta\n");

View file

@ -123,7 +123,7 @@ private:
long backend_pid;
int wait_event_type_col;
bool isrecovery;
bool isrecovery,track_commit_timestamp;
bool loaded;
long logfileLength;
wxColour bgColor;

View file

@ -13,9 +13,9 @@
#define VERSION_H
// Application Versions
#define VERSION_STR wxT("1.25.0 Dev ASUTP version with support PG12")
#define VERSION_NUM 1,25,0,0
#define VERSION_PACKAGE 1.25.0-dev
#define VERSION_STR wxT("1.26 Dev ASUTP support PG12")
#define VERSION_NUM 1,26,0,0
#define VERSION_PACKAGE 1.26.0-dev
#define PRERELEASE 1
// #define BUILD "..."