aboutsummaryrefslogtreecommitdiff
path: root/databases/pgadmin3
diff options
context:
space:
mode:
authorMax Khon <fjoe@FreeBSD.org>2019-12-09 09:29:12 +0000
committerMax Khon <fjoe@FreeBSD.org>2019-12-09 09:29:12 +0000
commit7cabf087a292e02761c591301097faeb0808069b (patch)
tree1e229e8735dd4d60352f6789f1749ed2bb0daa70 /databases/pgadmin3
parent0ff5aa22749c1fb346ce200bd51c5bdba0b50358 (diff)
downloadports-7cabf087a292e02761c591301097faeb0808069b.tar.gz
ports-7cabf087a292e02761c591301097faeb0808069b.zip
- Add support for PostgreSQL 10 [1]
- Add support for PostgreSQL 11 [2] - Fix query tool window crash [2] - Bump PORTREVISION PR: 236572, 238135 Submitted by: kirill@ironlogic.ru [2] Obtained from: Debian [1]
Notes
Notes: svn path=/head/; revision=519598
Diffstat (limited to 'databases/pgadmin3')
-rw-r--r--databases/pgadmin3/Makefile2
-rw-r--r--databases/pgadmin3/files/patch-pg1071
-rw-r--r--databases/pgadmin3/files/patch-pg1161
-rw-r--r--databases/pgadmin3/files/patch-pgversion13
-rw-r--r--databases/pgadmin3/files/patch-wxgtk328
5 files changed, 174 insertions, 1 deletions
diff --git a/databases/pgadmin3/Makefile b/databases/pgadmin3/Makefile
index e2040948113c..236d0af130f5 100644
--- a/databases/pgadmin3/Makefile
+++ b/databases/pgadmin3/Makefile
@@ -3,7 +3,7 @@
PORTNAME= pgadmin3
PORTVERSION= 1.22.2
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= databases
MASTER_SITES= PGSQL/pgadmin/pgadmin3/v${PORTVERSION}/src
DIST_SUBDIR= postgresql
diff --git a/databases/pgadmin3/files/patch-pg10 b/databases/pgadmin3/files/patch-pg10
new file mode 100644
index 000000000000..09eb34ca27c0
--- /dev/null
+++ b/databases/pgadmin3/files/patch-pg10
@@ -0,0 +1,71 @@
+Authors: Bernhard Rieder <bernhard@ratte.cc>, Christoph Berg <myon@debian.org>
+
+--- pgadmin/schema/pgServer.cpp
++++ pgadmin/schema/pgServer.cpp
+@@ -905,13 +905,24 @@ int pgServer::Connect(frmMain *form, boo
+ if (conn->BackendMinimumVersion(8, 5))
+ {
+ sql += wxT(", CASE WHEN usesuper THEN pg_is_in_recovery() ELSE NULL END as inrecovery");
+- sql += wxT(", CASE WHEN usesuper THEN pg_last_xlog_receive_location() ELSE NULL END as receiveloc");
+- sql += wxT(", CASE WHEN usesuper THEN pg_last_xlog_replay_location() ELSE NULL END as replayloc");
++ if (conn->BackendMinimumVersion(10, 0))
++ {
++ sql += wxT(", CASE WHEN usesuper THEN pg_last_wal_receive_lsn() ELSE NULL END as receiveloc");
++ sql += wxT(", CASE WHEN usesuper THEN pg_last_wal_replay_lsn() ELSE NULL END as replayloc");
++ }
++ else
++ {
++ sql += wxT(", CASE WHEN usesuper THEN pg_last_xlog_receive_location() ELSE NULL END as receiveloc");
++ sql += wxT(", CASE WHEN usesuper THEN pg_last_xlog_replay_location() ELSE NULL END as replayloc");
++ }
+ }
+ if (conn->BackendMinimumVersion(9, 1))
+ {
+ sql += wxT(", CASE WHEN usesuper THEN pg_last_xact_replay_timestamp() ELSE NULL END as replay_timestamp");
+- sql += wxT(", CASE WHEN usesuper AND pg_is_in_recovery() THEN pg_is_xlog_replay_paused() ELSE NULL END as isreplaypaused");
++ if (conn->BackendMinimumVersion(10, 0))
++ sql += wxT(", CASE WHEN usesuper AND pg_is_in_recovery() THEN pg_is_wal_replay_paused() ELSE NULL END as isreplaypaused");
++ else
++ sql += wxT(", CASE WHEN usesuper AND pg_is_in_recovery() THEN pg_is_xlog_replay_paused() ELSE NULL END as isreplaypaused");
+ }
+
+ pgSet *set = ExecuteSet(sql + wxT("\n FROM pg_user WHERE usename=current_user"));
+@@ -1355,7 +1366,11 @@ void pgServer::ShowStatistics(frmMain *f
+ wxString pidcol = GetConnection()->BackendMinimumVersion(9, 2) ? wxT("pid") : wxT("procpid");
+ wxString querycol = GetConnection()->BackendMinimumVersion(9, 2) ? wxT("query") : wxT("current_query");
+ wxString sql;
+- wxString replication_query = wxT("state || ' (' || sent_location || ' sent, ' || write_location || ' written, ' || flush_location || ' flushed, ' || replay_location || ' applied)'");
++ wxString replication_query;
++ if (conn->BackendMinimumVersion(10, 0))
++ replication_query = wxT("state || ' (' || sent_lsn || ' sent, ' || write_lsn || ' written, ' || flush_lsn || ' flushed, ' || replay_lsn || ' applied)'");
++ else
++ replication_query = wxT("state || ' (' || sent_location || ' sent, ' || write_location || ' written, ' || flush_location || ' flushed, ' || replay_location || ' applied)'");
+ wxLogInfo(wxT("Displaying statistics for server %s"), GetIdentifier().c_str());
+
+ // Add the statistics view columns
+@@ -1434,7 +1449,11 @@ bool pgServer::ReloadConfiguration()
+ bool pgServer::PauseReplay()
+ {
+ SetReplayPaused(true);
+- wxString sql = wxT("SELECT pg_xlog_replay_pause()");
++ wxString sql;
++ if (conn->BackendMinimumVersion(10, 0))
++ sql = wxT("SELECT pg_wal_replay_pause()");
++ else
++ sql = wxT("SELECT pg_xlog_replay_pause()");
+ return conn->ExecuteVoid(sql);
+ }
+
+@@ -1442,7 +1461,11 @@ bool pgServer::PauseReplay()
+ bool pgServer::ResumeReplay()
+ {
+ SetReplayPaused(false);
+- wxString sql = wxT("SELECT pg_xlog_replay_resume()");
++ wxString sql;
++ if (conn->BackendMinimumVersion(10, 0))
++ sql = wxT("SELECT pg_wal_replay_resume()");
++ else
++ sql = wxT("SELECT pg_xlog_replay_resume()");
+ return conn->ExecuteVoid(sql);
+ }
+
diff --git a/databases/pgadmin3/files/patch-pg11 b/databases/pgadmin3/files/patch-pg11
new file mode 100644
index 000000000000..ffa947013c4a
--- /dev/null
+++ b/databases/pgadmin3/files/patch-pg11
@@ -0,0 +1,61 @@
+--- pgadmin/schema/pgFunction.cpp.orig 2019-05-24 16:47:20.205020000 +0300
++++ pgadmin/schema/pgFunction.cpp 2019-05-24 16:56:08.010511000 +0300
+@@ -787,7 +787,17 @@
+ function->iSetArgDefValCount(functions->GetLong(wxT("pronargdefaults")));
+
+ // Check if it is a window function
+- function->iSetIsWindow(functions->GetBool(wxT("proiswindow")));
++ bool isWindow = false;
++ if (obj->GetConnection()->BackendMinimumVersion(11, 0))
++ {
++ char* c = functions->GetCharPtr(wxT("prokind"));
++ isWindow = c!=NULL && *c=='w';
++ }
++ else
++ {
++ isWindow = functions->GetBool(wxT("proiswindow"));
++ }
++ function->iSetIsWindow(isWindow);
+ }
+ else
+ function->iSetIsWindow(false);
+@@ -1060,10 +1071,10 @@
+
+ pgObject *pgFunctionFactory::CreateObjects(pgCollection *collection, ctlTree *browser, const wxString &restr)
+ {
+- wxString funcRestriction = wxT(
+- " WHERE proisagg = FALSE AND pronamespace = ") + NumToStr(collection->GetSchema()->GetOid())
+- + wxT("::oid\n AND typname NOT IN ('trigger', 'event_trigger') \n");
++ wxString funcRestriction = wxString::Format( wxT(" WHERE %s AND pronamespace = %lu::oid\n AND typname NOT IN ('trigger', 'event_trigger') \n"),
++ collection->GetConnection()->BackendMinimumVersion(11, 0) ? wxT(" pr.prokind!='a'") : wxT(" proisagg = FALSE"),
++ collection->GetSchema()->GetOid());
+
+ if (collection->GetConnection()->EdbMinimumVersion(8, 1))
+ funcRestriction += wxT(" AND NOT (lanname = 'edbspl' AND protype = '1')\n");
+ else if (collection->GetConnection()->EdbMinimumVersion(8, 0))
+@@ -1081,9 +1099,9 @@
+
+ pgObject *pgTriggerFunctionFactory::CreateObjects(pgCollection *collection, ctlTree *browser, const wxString &restr)
+ {
+- wxString funcRestriction = wxT(
+- " WHERE proisagg = FALSE AND pronamespace = ") + NumToStr(collection->GetSchema()->GetOid())
+- + wxT("::oid\n");
++ wxString funcRestriction = wxString::Format(wxT(" WHERE %s AND pronamespace = %lu::oid\n"),
++ collection->GetConnection()->BackendMinimumVersion(11, 0) ? wxT(" pr.prokind!='a'") : wxT(" proisagg = FALSE"),
++ collection->GetSchema()->GetOid());
+ if(collection->GetConnection()->BackendMinimumVersion(9, 3))
+ {
+ funcRestriction += wxT("AND (typname IN ('trigger', 'event_trigger') \nAND lanname NOT IN ('edbspl', 'sql', 'internal'))");
+@@ -1100,9 +1125,9 @@
+
+ pgObject *pgProcedureFactory::CreateObjects(pgCollection *collection, ctlTree *browser, const wxString &restr)
+ {
+- wxString funcRestriction = wxT(
+- " WHERE proisagg = FALSE AND pronamespace = ") + NumToStr(collection->GetSchema()->GetOid())
+- + wxT("::oid AND lanname = 'edbspl'\n");
++ wxString funcRestriction = wxString::Format(wxT(" WHERE %s AND pronamespace = %lu::oid AND lanname = 'edbspl'\n"),
++ collection->GetConnection()->BackendMinimumVersion(11, 0) ? wxT(" pr.prokind!='a'") : wxT(" proisagg = FALSE"),
++ collection->GetSchema()->GetOid());
+
+ if (collection->GetConnection()->EdbMinimumVersion(8, 1))
+ funcRestriction += wxT(" AND protype = '1'\n");
diff --git a/databases/pgadmin3/files/patch-pgversion b/databases/pgadmin3/files/patch-pgversion
new file mode 100644
index 000000000000..dabe2915e7ef
--- /dev/null
+++ b/databases/pgadmin3/files/patch-pgversion
@@ -0,0 +1,13 @@
+--- pgadmin/include/pgAdmin3.h
++++ pgadmin/include/pgAdmin3.h
+@@ -58,8 +58,8 @@
+ // Supported server minimum and maximum values.
+ const short SERVER_MIN_VERSION_N = 0x0804;
+ const wxString SERVER_MIN_VERSION_T = wxT("8.4");
+-const short SERVER_MAX_VERSION_N = 0x0906;
+-const wxString SERVER_MAX_VERSION_T = wxT("9.6");
++const short SERVER_MAX_VERSION_N = 0x7FFF; /* Don't check for maximally supported PG version. */
++const wxString SERVER_MAX_VERSION_T = wxT("99");
+
+ // Supported Greenplum Database and Greenplum HAWQ minimum and maximum values.
+ const short GP_MIN_VERSION_N = 0x0802;
diff --git a/databases/pgadmin3/files/patch-wxgtk3 b/databases/pgadmin3/files/patch-wxgtk3
new file mode 100644
index 000000000000..e3b0cbfe211c
--- /dev/null
+++ b/databases/pgadmin3/files/patch-wxgtk3
@@ -0,0 +1,28 @@
+*** pgadmin/frm/frmQuery.cpp.orig Thu Jan 7 15:47:32 2016
+--- pgadmin/frm/frmQuery.cpp Sat May 25 18:03:04 2019
+***************
+*** 1795,1800 ****
+--- 1795,1805 ----
+
+ void frmQuery::OnPositionStc(wxStyledTextEvent &event)
+ {
++ CallAfter(&frmQuery::DoUpdatePositionStc,event);
++ }
++
++ void frmQuery::DoUpdatePositionStc(const wxStyledTextEvent &event)
++ {
+ int selFrom, selTo, selCount;
+ sqlQuery->GetSelection(&selFrom, &selTo);
+ selCount = selTo - selFrom;
+*** pgadmin/include/frm/frmQuery.h.orig Thu Jan 7 15:47:32 2016
+--- pgadmin/include/frm/frmQuery.h Sat May 25 18:03:56 2019
+***************
+*** 171,176 ****
+--- 171,177 ----
+
+ void OnChangeStc(wxStyledTextEvent &event);
+ void OnPositionStc(wxStyledTextEvent &event);
++ void DoUpdatePositionStc(const wxStyledTextEvent &event);
+ void OnClose(wxCloseEvent &event);
+ void OnSetFocus(wxFocusEvent &event);
+ void OnContents(wxCommandEvent &event);