Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Dec 2019 09:29:12 +0000 (UTC)
From:      Max Khon <fjoe@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r519598 - in head/databases/pgadmin3: . files
Message-ID:  <201912090929.xB99TChW072598@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: fjoe
Date: Mon Dec  9 09:29:12 2019
New Revision: 519598
URL: https://svnweb.freebsd.org/changeset/ports/519598

Log:
  - 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]

Added:
  head/databases/pgadmin3/files/patch-pg10   (contents, props changed)
  head/databases/pgadmin3/files/patch-pg11   (contents, props changed)
  head/databases/pgadmin3/files/patch-pgversion   (contents, props changed)
  head/databases/pgadmin3/files/patch-wxgtk3   (contents, props changed)
Modified:
  head/databases/pgadmin3/Makefile

Modified: head/databases/pgadmin3/Makefile
==============================================================================
--- head/databases/pgadmin3/Makefile	Mon Dec  9 09:24:14 2019	(r519597)
+++ head/databases/pgadmin3/Makefile	Mon Dec  9 09:29:12 2019	(r519598)
@@ -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

Added: head/databases/pgadmin3/files/patch-pg10
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/pgadmin3/files/patch-pg10	Mon Dec  9 09:29:12 2019	(r519598)
@@ -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);
+ }
+ 

Added: head/databases/pgadmin3/files/patch-pg11
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/pgadmin3/files/patch-pg11	Mon Dec  9 09:29:12 2019	(r519598)
@@ -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");

Added: head/databases/pgadmin3/files/patch-pgversion
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/pgadmin3/files/patch-pgversion	Mon Dec  9 09:29:12 2019	(r519598)
@@ -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;

Added: head/databases/pgadmin3/files/patch-wxgtk3
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/pgadmin3/files/patch-wxgtk3	Mon Dec  9 09:29:12 2019	(r519598)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912090929.xB99TChW072598>