Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aLfAg-0005OP-AL for pgadmin-hackers@arkaria.postgresql.org; Tue, 19 Jan 2016 22:54:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aLfAf-0004wV-Ou for pgadmin-hackers@arkaria.postgresql.org; Tue, 19 Jan 2016 22:54:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aLfAf-0004wO-Cx for pgadmin-hackers@postgresql.org; Tue, 19 Jan 2016 22:54:41 +0000 Received: from palladium.wars-nicht.de ([89.238.64.91] helo=polonium.wars-nicht.de) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aLfAU-0001yF-Ds for pgadmin-hackers@postgresql.org; Tue, 19 Jan 2016 22:54:40 +0000 Received: from localhost (localhost [127.0.0.1]) by polonium.wars-nicht.de (Postfix) with ESMTP id 7F2CF114037 for ; Tue, 19 Jan 2016 23:54:28 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at polonium X-Spam-Flag: NO X-Spam-Score: -2.9 X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9] autolearn=ham autolearn_force=no Received: from polonium.wars-nicht.de ([127.0.0.1]) by localhost (polonium.wars-nicht.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xmczyKyNuaJw for ; Tue, 19 Jan 2016 23:54:27 +0100 (CET) Received: from diamond.wars-nicht.de (b2b-78-94-24-146.unitymedia.biz [78.94.24.146]) by polonium.wars-nicht.de (Postfix) with ESMTPSA id 528F4114035 for ; Tue, 19 Jan 2016 23:54:27 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) by diamond.wars-nicht.de (Postfix) with ESMTP id 03C0B1BE5B73 for ; Tue, 19 Jan 2016 23:54:27 +0100 (CET) Subject: Re: Remove "unsupported version" warning for Greenplum To: pgadmin-hackers@postgresql.org References: <569C4395.4080603@wars-nicht.de> From: Andreas 'ads' Scherbaum Message-ID: <569EBEA2.5040903@wars-nicht.de> Date: Tue, 19 Jan 2016 23:54:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------060905050809020109070507" X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org This is a multi-part message in MIME format. --------------060905050809020109070507 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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 --------------060905050809020109070507 Content-Type: text/x-patch; name="gp-warning2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gp-warning2.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; --------------060905050809020109070507 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers --------------060905050809020109070507--