public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andreas 'ads' Scherbaum <[email protected]>
To: [email protected]
Subject: Re: Remove "unsupported version" warning for Greenplum
Date: Tue, 19 Jan 2016 23:54:26 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+OCxoxZQzjb5OMRGJp+WiYLhEpvGqer-QLLhutRivea575KvA@mail.gmail.com>
References: <[email protected]>
	<CA+OCxoxZQzjb5OMRGJp+WiYLhEpvGqer-QLLhutRivea575KvA@mail.gmail.com>
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgadmin-hackers>

On 19.01.2016 16:03, Dave Page wrote:
>
> Your patch won't apply again. I have no idea why - I'm trying to do it
> on my Mac, which is a *nix under the hood (they don't use Mac line
> endings any more - that was the old Mac OS 9 and earlier from a decade
> or so ago iirc). How are you creating them? The normal way is to do
> something like:

And how does the attached work? Fresh clone again, only difference is a 
warning (not an error) for whitespaces removed.


Regards

-- 
				Andreas 'ads' Scherbaum
German PostgreSQL User Group
European PostgreSQL User Group - Board of Directors
Volunteer Regional Contact, Germany - PostgreSQL Project


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Attachments:

  [text/x-patch] gp-warning2.diff (3.1K, 2-gp-warning2.diff)
  download | inline diff:
diff --git a/pgadmin/schema/pgServer.cpp b/pgadmin/schema/pgServer.cpp
index b263f7c..ad47851 100644
--- a/pgadmin/schema/pgServer.cpp
+++ b/pgadmin/schema/pgServer.cpp
@@ -835,14 +835,47 @@ int pgServer::Connect(frmMain *form, bool askPassword, const wxString &pwd, bool
 		dbOid = conn->GetDbOid();
 
 		// Check the server version
-		if (!(conn->BackendMinimumVersion(SERVER_MIN_VERSION_N >> 8, SERVER_MIN_VERSION_N & 0x00FF)) ||
-		        (conn->BackendMinimumVersion(SERVER_MAX_VERSION_N >> 8, (SERVER_MAX_VERSION_N & 0x00FF) + 1)))
+		if (conn->GetIsGreenplum())
 		{
-			wxLogWarning(_("The server you are connecting to is not a version that is supported by this release of %s.\n\n%s may not function as expected.\n\nSupported server versions are %s to %s."),
-			             appearanceFactory->GetLongAppName().c_str(),
-			             appearanceFactory->GetLongAppName().c_str(),
-			             wxString(SERVER_MIN_VERSION_T).c_str(),
-			             wxString(SERVER_MAX_VERSION_T).c_str());
+			// Check for Greenplum specific version
+			// Greenplum always shows PG version "8.2.15" for now
+			// this might change once the merge with recent PG versions makes progress
+			// therefore also check for the max version
+			const short GP_MIN_VERSION_N = 0x0802;
+			const wxString GP_MIN_VERSION_T = wxT("8.2");
+			const short GP_MAX_VERSION_N = 0x0802;
+			const wxString GP_MAX_VERSION_T = wxT("8.2");
+			if (!(conn->BackendMinimumVersion(GP_MIN_VERSION_N >> 8, GP_MIN_VERSION_N & 0x00FF)) ||
+				(conn->BackendMinimumVersion(GP_MAX_VERSION_N >> 8, (GP_MAX_VERSION_N & 0x00FF) + 1)))
+			{
+				if (GP_MIN_VERSION_N == GP_MAX_VERSION_N)
+				{
+					wxLogWarning(_("The server you are connecting to is not a version that is supported by this release of %s.\n\n%s may not function as expected.\n\nSupported server version is %s."),
+					             appearanceFactory->GetLongAppName().c_str(),
+					             appearanceFactory->GetLongAppName().c_str(),
+					             wxString(GP_MIN_VERSION_T).c_str());
+				}
+				else
+				{
+					wxLogWarning(_("The server you are connecting to is not a version that is supported by this release of %s.\n\n%s may not function as expected.\n\nSupported server versions are %s to %s."),
+					             appearanceFactory->GetLongAppName().c_str(),
+					             appearanceFactory->GetLongAppName().c_str(),
+					             wxString(GP_MIN_VERSION_T).c_str(),
+					             wxString(GP_MAX_VERSION_T).c_str());
+				}
+			}
+		}
+		else
+		{
+			if (!(conn->BackendMinimumVersion(SERVER_MIN_VERSION_N >> 8, SERVER_MIN_VERSION_N & 0x00FF)) ||
+			        (conn->BackendMinimumVersion(SERVER_MAX_VERSION_N >> 8, (SERVER_MAX_VERSION_N & 0x00FF) + 1)))
+			{
+				wxLogWarning(_("The server you are connecting to is not a version that is supported by this release of %s.\n\n%s may not function as expected.\n\nSupported server versions are %s to %s."),
+				             appearanceFactory->GetLongAppName().c_str(),
+				             appearanceFactory->GetLongAppName().c_str(),
+				             wxString(SERVER_MIN_VERSION_T).c_str(),
+				             wxString(SERVER_MAX_VERSION_T).c_str());
+			}
 		}
 
 		connected = true;


view thread (16+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: Remove "unsupported version" warning for Greenplum
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox