diff --git a/db/pgConn.cpp b/db/pgConn.cpp index 55ab179..a86ce72 100644 --- a/db/pgConn.cpp +++ b/db/pgConn.cpp @@ -204,7 +204,6 @@ pgConn::pgConn(const wxString &server, const wxString &service, const wxString & dbHostName = server; dbRole = rolename; -#ifdef HAVE_CONNINFO_PARSE if (!applicationname.IsEmpty()) { // Check connection string with application_name @@ -219,7 +218,6 @@ pgConn::pgConn(const wxString &server, const wxString &service, const wxString & connstr = connstr_with_applicationname; } } -#endif // Open the connection wxString cleanConnStr = connstr; diff --git a/schema/pgObject.cpp b/schema/pgObject.cpp index 24b278b..1b7233c 100644 --- a/schema/pgObject.cpp +++ b/schema/pgObject.cpp @@ -420,6 +420,9 @@ void pgObject::ShowDependency(pgDatabase *db, ctlListView *list, const wxString case 'i': depFactory = &indexFactory; break; + case 'I': + depFactory = &indexFactory; + break; case 'E': depFactory = &extensionFactory; break; @@ -546,6 +549,18 @@ void pgObject::ShowDependency(pgDatabase *db, ctlListView *list, const wxString deptype = wxT("pin"); typname = wxEmptyString; break; + case 'S': + deptype = wxT("sec_partition"); + break; + case 'P': + deptype = wxT("pri_partition"); + break; + case 'e': + deptype = _("extension"); + break; + case 'x': + deptype = _("auto"); + break; default: break; } @@ -903,7 +918,7 @@ void pgObject::ShowDependents(frmMain* form, ctlListView* referencedBy, const wx wxString strQuery = wxT("SELECT ref.relname AS refname, d2.refclassid, dep.deptype AS deptype\n") wxT(" FROM pg_depend dep\n") - wxT(" LEFT JOIN pg_depend d2 ON dep.objid=d2.objid AND dep.refobjid != d2.refobjid\n") + wxT(" LEFT JOIN pg_depend d2 ON dep.objid=d2.objid AND dep.refobjid != d2.refobjid AND d2.classid=dep.classid\n") wxT(" LEFT JOIN pg_class ref ON ref.oid=d2.refobjid\n") wxT(" LEFT JOIN pg_attribute att ON d2.refclassid=att.attrelid AND d2.refobjsubid=att.attnum\n") + where + @@ -1566,15 +1581,24 @@ void pgDatabaseObject::DisplayStatistics(ctlListView *statistics, const wxString wxArrayInt a; int vmax = -1; int lt = -1; + wxWindowDC dc(statistics); + int wspc, wR = 0, h, wtext, widhspace = 50; + wxString rowmark(L"\x21d2"); + dc.GetTextExtent(' ', &wspc, &h); + dc.GetTextExtent(rowmark, &wR, &h); + if (wR == 0) { + rowmark = "R"; + dc.GetTextExtent(rowmark, &wR, &h); + } for (col = 0 ; col < stats->NumCols() ; col++) { if (!stats->ColName(col).IsEmpty()) { wxString name = stats->ColName(col); wxString vl = stats->GetVal(col); if (vl.IsNumber() && vl.Length()>0) { - int l = vl.Length(); - if (l > vmax) vmax = l; - a.Add(l); + dc.GetTextExtent(vl, &wtext, &h); + if (wtext > vmax) vmax = wtext; + a.Add(wtext); if (_("Live Tuples") == name) lt = a.GetCount() - 1; } else a.Add(-1); @@ -1588,8 +1612,13 @@ void pgDatabaseObject::DisplayStatistics(ctlListView *statistics, const wxString wxLongLong l = StrToLongLong(str); wxString h = NumToStrHuman(l); if (h.IsEmpty()) continue; - str += generate_spaces(vmax - a[i] + 5) + h; - if (lt == i) str[vmax + 2] = 'R'; + int nspc = (vmax - a[i] + widhspace) / wspc; + if (lt == i) { + nspc = (vmax - a[i]) / wspc; + wxString s = generate_spaces((widhspace - wR) / wspc / 2); + str += generate_spaces(nspc) + s + rowmark + s + h; + } + else str += generate_spaces(nspc) + h; statistics->SetItem(i, 1, str); } diff --git a/schema/pgServer.cpp b/schema/pgServer.cpp index 6f9390c..117023c 100644 --- a/schema/pgServer.cpp +++ b/schema/pgServer.cpp @@ -805,7 +805,11 @@ int pgServer::Connect(frmMain *form, bool askPassword, const wxString &pwd, bool iPort = port; } wxString usr=wxEmptyString; - wxGetEnv(wxT("USERNAME"),&usr); +#ifndef __WXMSW__ + wxGetEnv(wxT("USER"), &usr); +#else + wxGetEnv(wxT("USERNAME"), &usr); +#endif if (database.IsEmpty()) { conn = new pgConn(host, service, hostaddr, DEFAULT_PG_DATABASE, username, password, iPort, rolename,connstr, ssl, 0, appearanceFactory->GetLongAppName() +wxT(" - ")+ usr, sslcert, sslkey, sslrootcert, sslcrl, sslcompression); diff --git a/x64/Release_(3.0)/pgAdmin3.exe b/x64/Release_(3.0)/pgAdmin3.exe index 499d77e..463bfe4 100644 Binary files a/x64/Release_(3.0)/pgAdmin3.exe and b/x64/Release_(3.0)/pgAdmin3.exe differ