Log Message:
-----------
Work correctly with new >8.0 BETA2 compatible pg_logdir_ls.
Modified Files:
--------------
pgadmin3/src/db:
pgConn.cpp (r1.54 -> r1.55)
pgadmin3/src/include:
frmStatus.h (r1.15 -> r1.16)
pgfeatures.h (r1.3 -> r1.4)
pgadmin3/src/ui:
frmStatus.cpp (r1.40 -> r1.41)
Index: pgConn.cpp
===================================================================
RCS file: /projects/pgadmin3/src/db/pgConn.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -Lsrc/db/pgConn.cpp -Lsrc/db/pgConn.cpp -u -w -r1.54 -r1.55
--- src/db/pgConn.cpp
+++ src/db/pgConn.cpp
@@ -468,6 +468,10 @@
wxT(" WHERE proname = 'pg_terminate_backend'")
wxT( " AND pronargs = 1"))
.IsEmpty();
+ features[FEATURE_STANDARD_LOGNAME_FORMAT] =
+ ExecuteScalar(
+ wxT("SHOW log_filename"))
+ == wxT("postgresql-%Y-%m-%d_%H%M%S.log");
}
if (featureNo < 1 ||featureNo >= FEATURE_LAST)
Index: pgfeatures.h
===================================================================
RCS file: /projects/pgadmin3/src/include/pgfeatures.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lsrc/include/pgfeatures.h -Lsrc/include/pgfeatures.h -u -w -r1.3 -r1.4
--- src/include/pgfeatures.h
+++ src/include/pgfeatures.h
@@ -17,5 +17,6 @@
FEATURE_ROTATELOG,
FEATURE_POSTMASTER_STARTTIME,
FEATURE_TERMINATE_BACKEND,
+ FEATURE_STANDARD_LOGNAME_FORMAT,
FEATURE_LAST
};
Index: frmStatus.h
===================================================================
RCS file: /projects/pgadmin3/src/include/frmStatus.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -Lsrc/include/frmStatus.h -Lsrc/include/frmStatus.h -u -w -r1.15 -r1.16
--- src/include/frmStatus.h
+++ src/include/frmStatus.h
@@ -53,7 +53,7 @@
void emptyLogfileCombo();
void addLogFile(wxDateTime *dt, bool skipFirst);
- void addLogFile(const wxString &filename, const wxDateTime timestamp, int pid,
long len, long &read, bool skipFirst);
+ void addLogFile(const wxString &filename, const wxDateTime timestamp, long len,
long &read, bool skipFirst);
void addLogLine(const wxString &str, bool formatted=true);
void checkConnection();
@@ -66,7 +66,6 @@
wxDateTime logfileTimestamp, latestTimestamp;
wxString logDirectory, logfileName;
- long logfilePid;
bool showCurrent, isCurrent;
pgConn *connection;
Index: frmStatus.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/frmStatus.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -Lsrc/ui/frmStatus.cpp -Lsrc/ui/frmStatus.cpp -u -w -r1.40 -r1.41
--- src/ui/frmStatus.cpp
+++ src/ui/frmStatus.cpp
@@ -117,7 +117,9 @@
lockList->AddColumn(_("Query"), 500);
}
- if (connection->BackendMinimumVersion(7, 5) &&
connection->HasFeature(FEATURE_FILEREAD))
+ if (connection->BackendMinimumVersion(7, 5) &&
+ connection->HasFeature(FEATURE_FILEREAD) &&
+ connection->HasFeature(FEATURE_STANDARD_LOGNAME_FORMAT))
{
logFormat = connection->ExecuteScalar(wxT("SHOW log_line_prefix"));
if (logFormat == wxT("unset"))
@@ -459,7 +461,7 @@
if (newlen > logfileLength)
{
statusBar->SetStatusText(_("Refreshing."));
- addLogFile(logfileName, logfileTimestamp, logfilePid, newlen,
logfileLength, false);
+ addLogFile(logfileName, logfileTimestamp, newlen, logfileLength,
false);
statusBar->SetStatusText(_("Done."));
// as long as there was new data, the logfile is probably the current
@@ -519,24 +521,23 @@
void frmStatus::addLogFile(wxDateTime *dt, bool skipFirst)
{
pgSet *set=connection->ExecuteSet(
- wxT("SELECT filetime, pid, filename, pg_file_length(filename) AS len\n")
+ wxT("SELECT filetime, filename, pg_file_length(filename) AS len\n")
wxT(" FROM pg_logdir_ls\n")
wxT(" WHERE filetime = '") + DateToAnsiStr(*dt) + wxT("'::timestamp"));
if (set)
{
logfileName = set->GetVal(wxT("filename"));
logfileTimestamp = set->GetDateTime(wxT("filetime"));
- logfilePid = set->GetLong(wxT("pid"));
long len=set->GetLong(wxT("len"));
logfileLength = 0;
- addLogFile(logfileName, logfileTimestamp, logfilePid, len, logfileLength,
skipFirst);
+ addLogFile(logfileName, logfileTimestamp, len, logfileLength, skipFirst);
delete set;
}
}
-void frmStatus::addLogFile(const wxString &filename, const wxDateTime timestamp, int
pid, long len, long &read, bool skipFirst)
+void frmStatus::addLogFile(const wxString &filename, const wxDateTime timestamp, long
len, long &read, bool skipFirst)
{
wxString line;
@@ -684,7 +685,7 @@
count--;
pgSet *set=connection->ExecuteSet(
- wxT("SELECT filename, pid, filetime FROM pg_logdir_ls\n")
+ wxT("SELECT filename, filetime FROM pg_logdir_ls\n")
wxT(" ORDER BY filetime ASC"));
if (set)
{
@@ -698,10 +699,9 @@
{
count++;
wxString fn= set->GetVal(wxT("filename"));
- long pid = set->GetLong(wxT("pid"));
wxDateTime ts=set->GetDateTime(wxT("filetime"));
- cbLogfiles->Append(DateToStr(ts) + wxT(" (") + NumToStr(pid) + wxT(")"),
new wxDateTime(ts));
+ cbLogfiles->Append(DateToAnsiStr(ts), new wxDateTime(ts));
set->MoveNext();
}
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly