You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@madlib.apache.org by snaga <gi...@git.apache.org> on 2016/07/19 10:54:34 UTC

[GitHub] incubator-madlib pull request #57: Add PostgreSQL 9.5 and 9.6 support.

GitHub user snaga opened a pull request:

    https://github.com/apache/incubator-madlib/pull/57

    Add PostgreSQL 9.5 and 9.6 support.

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/snaga/incubator-madlib v1.9-pg96

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-madlib/pull/57.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #57
    
----
commit 6141b29c9b6e8ec714d172a3a12ab5ba70e64946
Author: Satoshi Nagayasu <sn...@uptime.jp>
Date:   2016-07-19T10:06:24Z

    Add PostgreSQL 9.5 support.
    
    Add CMakeLists.txt and FindPostgreSQL_9_5.cmake to allow
    building with PostgreSQL 9.5.

commit fae02ba6bba7b2fc646772387066ea698ef6a67c
Author: Satoshi Nagayasu <sn...@uptime.jp>
Date:   2016-07-19T10:16:01Z

    Fix to remove madlib.array_agg() in 9.5 or later.
    
    pg_catalog.array_agg() which can take 'anyarray' as an argument
    is added in 9.5, so the compatibility function madlib.array_agg()
    is no longer needed in 9.5 or later.
    
    See the 9.5 release note for more information.
    https://www.postgresql.org/docs/9.5/static/release-9-5.html#AEN127021

commit 18687cead8ba96f75344e2dcac0b0d2480eecf91
Author: Satoshi Nagayasu <sn...@uptime.jp>
Date:   2016-07-19T10:22:22Z

    Add PostgreSQL 9.6 support.
    
    Add CMakeLists.txt and FindPostgreSQL_9_6.cmake to allow
    building with PostgreSQL 9.6.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-madlib pull request #57: Add PostgreSQL 9.5 and 9.6 support.

Posted by snaga <gi...@git.apache.org>.
Github user snaga commented on a diff in the pull request:

    https://github.com/apache/incubator-madlib/pull/57#discussion_r71476210
  
    --- Diff: methods/array_ops/src/pg_gp/array_ops.sql_in ---
    @@ -602,11 +602,22 @@ m4_ifdef(`__HAS_FUNCTION_PROPERTIES__', `NO SQL', `');
      *        in later GPDB and Postgres versions.
      */
     DROP AGGREGATE IF EXISTS MADLIB_SCHEMA.array_agg(anyelement) CASCADE;
    -CREATE AGGREGATE MADLIB_SCHEMA.array_agg( anyelement) (
    -   SFUNC     = array_append,
    -   STYPE     = anyarray
    -   m4_ifdef( `__POSTGRESQL__', `', `, PREFUNC   = array_cat')
    -);
    +DO $$
    +BEGIN
    +  --
    +  -- array_agg() compatibility function is only needed PostgreSQL 9.4 or earlier
    +  -- because 9.5 or later has pg_catalog.array_agg(anyarray).
    +  --
    +  IF regexp_replace(version(), '.*PostgreSQL (\d+\.\d+).*', '\1')::float8 < 9.5 THEN
    --- End diff --
    
    If we can drop this function at all, it would make things simpler. Does the latest GPDB have array_agg(anyarray) function? I'm not familiar with GPDB.
    
    I'm not sure MADlib could work with 9.4 without this function, but at least, we need to drop this function for 9.5 or later because the function signature causes a conflict error with the built-in one.
    
    BTW, is there any MADlib docs mentioning "current supported platform"? I could not find it...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-madlib issue #57: MADLIB-944: Add PostgreSQL 9.5 and 9.6 support

Posted by snaga <gi...@git.apache.org>.
Github user snaga commented on the issue:

    https://github.com/apache/incubator-madlib/pull/57
  
    Anyway, I always do `make package` and `rpm -i` to install MADlib, so I haven't tried `make install` actually.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-madlib issue #57: Add PostgreSQL 9.5 and 9.6 support.

Posted by snaga <gi...@git.apache.org>.
Github user snaga commented on the issue:

    https://github.com/apache/incubator-madlib/pull/57
  
    Hi, I updated the PR and confirmed that "install-check" can pass on 9.4, 9.5 and 9.6beta2.
    Please take a look.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-madlib issue #57: Add PostgreSQL 9.5 and 9.6 support.

Posted by danielgustafsson <gi...@git.apache.org>.
Github user danielgustafsson commented on the issue:

    https://github.com/apache/incubator-madlib/pull/57
  
    The current version of GPDB (4.3.8.x) does not have `array_agg(anyarray)` and it's not included in the upcoming 5.0 codebase either.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-madlib pull request #57: Add PostgreSQL 9.5 and 9.6 support.

Posted by decibel <gi...@git.apache.org>.
Github user decibel commented on a diff in the pull request:

    https://github.com/apache/incubator-madlib/pull/57#discussion_r71334109
  
    --- Diff: methods/array_ops/src/pg_gp/array_ops.sql_in ---
    @@ -602,11 +602,22 @@ m4_ifdef(`__HAS_FUNCTION_PROPERTIES__', `NO SQL', `');
      *        in later GPDB and Postgres versions.
      */
     DROP AGGREGATE IF EXISTS MADLIB_SCHEMA.array_agg(anyelement) CASCADE;
    -CREATE AGGREGATE MADLIB_SCHEMA.array_agg( anyelement) (
    -   SFUNC     = array_append,
    -   STYPE     = anyarray
    -   m4_ifdef( `__POSTGRESQL__', `', `, PREFUNC   = array_cat')
    -);
    +DO $$
    +BEGIN
    +  --
    +  -- array_agg() compatibility function is only needed PostgreSQL 9.4 or earlier
    +  -- because 9.5 or later has pg_catalog.array_agg(anyarray).
    +  --
    +  IF regexp_replace(version(), '.*PostgreSQL (\d+\.\d+).*', '\1')::float8 < 9.5 THEN
    --- End diff --
    
    It would be more straightforward to do current_setting('server_version_num')::int>=90500


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-madlib pull request #57: MADLIB-944: Add PostgreSQL 9.5 and 9.6 su...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-madlib/pull/57


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-madlib issue #57: MADLIB-944: Add PostgreSQL 9.5 and 9.6 support

Posted by snaga <gi...@git.apache.org>.
Github user snaga commented on the issue:

    https://github.com/apache/incubator-madlib/pull/57
  
    Hi @vadv, thanks for the feedback.
    I guess something around cmake may have an issue in your case because `SQLcommon.m4` is generated by cmake during the build.
    Could you please check and share your `build/src/ports/postgres/9.5/madpack/SQLCommon.m4` for more information?



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-madlib issue #57: Add PostgreSQL 9.5 and 9.6 support.

Posted by fmcquillan99 <gi...@git.apache.org>.
Github user fmcquillan99 commented on the issue:

    https://github.com/apache/incubator-madlib/pull/57
  
    Here are the supported platforms for MADlib 1.9:
    https://cwiki.apache.org/confluence/display/MADLIB/FAQ#FAQ-Q1-2WhatplatformsdoesMADlibsupport?
    
    Will update this for 1.9.1 to include Postgres 9.5, 9.6
    
    Typically the last two versions of each platforms are supported with each MADlib release.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-madlib issue #57: MADLIB-944: Add PostgreSQL 9.5 and 9.6 support

Posted by iyerr3 <gi...@git.apache.org>.
Github user iyerr3 commented on the issue:

    https://github.com/apache/incubator-madlib/pull/57
  
    LGTM. 
    
    Both 9.4 and 9.5 worked without the madlib.array_agg function - I suggest we delete it as part of this commit. None of the MADlib functions use it anyways (except LDA which was been fixed here). 
    
    @snaga I can do the deletion along with the merge if you're OK. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-madlib issue #57: MADLIB-944: Add PostgreSQL 9.5 and 9.6 support

Posted by iyerr3 <gi...@git.apache.org>.
Github user iyerr3 commented on the issue:

    https://github.com/apache/incubator-madlib/pull/57
  
    @snaga MADlib is supported for GPDB 4.2 and 4.3 and both versions have the `array_agg(anyelement)` function. 
    
    I'll delete the function and merge this PR. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-madlib pull request #57: Add PostgreSQL 9.5 and 9.6 support.

Posted by snaga <gi...@git.apache.org>.
Github user snaga commented on a diff in the pull request:

    https://github.com/apache/incubator-madlib/pull/57#discussion_r71436485
  
    --- Diff: methods/array_ops/src/pg_gp/array_ops.sql_in ---
    @@ -602,11 +602,22 @@ m4_ifdef(`__HAS_FUNCTION_PROPERTIES__', `NO SQL', `');
      *        in later GPDB and Postgres versions.
      */
     DROP AGGREGATE IF EXISTS MADLIB_SCHEMA.array_agg(anyelement) CASCADE;
    -CREATE AGGREGATE MADLIB_SCHEMA.array_agg( anyelement) (
    -   SFUNC     = array_append,
    -   STYPE     = anyarray
    -   m4_ifdef( `__POSTGRESQL__', `', `, PREFUNC   = array_cat')
    -);
    +DO $$
    +BEGIN
    +  --
    +  -- array_agg() compatibility function is only needed PostgreSQL 9.4 or earlier
    +  -- because 9.5 or later has pg_catalog.array_agg(anyarray).
    +  --
    +  IF regexp_replace(version(), '.*PostgreSQL (\d+\.\d+).*', '\1')::float8 < 9.5 THEN
    --- End diff --
    
    @decibel Looks better. Will replace with it. Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-madlib pull request #57: Add PostgreSQL 9.5 and 9.6 support.

Posted by iyerr3 <gi...@git.apache.org>.
Github user iyerr3 commented on a diff in the pull request:

    https://github.com/apache/incubator-madlib/pull/57#discussion_r71447310
  
    --- Diff: methods/array_ops/src/pg_gp/array_ops.sql_in ---
    @@ -602,11 +602,22 @@ m4_ifdef(`__HAS_FUNCTION_PROPERTIES__', `NO SQL', `');
      *        in later GPDB and Postgres versions.
      */
     DROP AGGREGATE IF EXISTS MADLIB_SCHEMA.array_agg(anyelement) CASCADE;
    -CREATE AGGREGATE MADLIB_SCHEMA.array_agg( anyelement) (
    -   SFUNC     = array_append,
    -   STYPE     = anyarray
    -   m4_ifdef( `__POSTGRESQL__', `', `, PREFUNC   = array_cat')
    -);
    +DO $$
    +BEGIN
    +  --
    +  -- array_agg() compatibility function is only needed PostgreSQL 9.4 or earlier
    +  -- because 9.5 or later has pg_catalog.array_agg(anyarray).
    +  --
    +  IF regexp_replace(version(), '.*PostgreSQL (\d+\.\d+).*', '\1')::float8 < 9.5 THEN
    --- End diff --
    
    I'm confused about this change and why we even need this function. Older versions of GPDB did not have array_agg (since they were based on PG 8.3) and needed this function. All currently supported platforms have this functionality. I realize 9.5 also supports array_agg(anyarray), but this function was not intended to provide that feature. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-madlib issue #57: MADLIB-944: Add PostgreSQL 9.5 and 9.6 support

Posted by snaga <gi...@git.apache.org>.
Github user snaga commented on the issue:

    https://github.com/apache/incubator-madlib/pull/57
  
    @iyerr3 I think the code of madlib.array_agg() function is shared among PostgreSQL and GPDB. PostgreSQL (9.3~9.6) can work without this function, but GPDB still needs this function. Thus, it needs to be kept in this source for GPDB, doesn't it?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-madlib issue #57: MADLIB-944: Add PostgreSQL 9.5 and 9.6 support

Posted by vadv <gi...@git.apache.org>.
Github user vadv commented on the issue:

    https://github.com/apache/incubator-madlib/pull/57
  
    Hello!
    After build and `make install` with this patch, I can't install madlib on PostgreSQL 9.5:
    ```
    madpack.py : INFO : Detected PostgreSQL version 9.5.
    madpack.py : INFO : *** Installing MADlib ***
    madpack.py : INFO : MADlib tools version    = 1.9 (/usr/local/madlib/Versions/1.9/bin/../madpack/madpack.py)
    madpack.py : INFO : MADlib database version = None (host=localhost:5432, db=gis, schema=madlib)
    madpack.py : INFO : Testing PL/Python environment...
    madpack.py : INFO : > Creating language PL/Python...
    madpack.py : INFO : > PL/Python environment OK (version: 2.7.12)
    madpack.py : INFO : Installing MADlib into MADLIB schema...
    madpack.py : INFO : > Creating MADLIB schema
    madpack.py : INFO : > Creating MADLIB.MigrationHistory table
    madpack.py : INFO : > Writing version info in MigrationHistory table
    madpack.py : INFO : > Creating objects for modules:
    madpack.py : INFO : > - array_ops
    madpack.py : ERROR : Failed executing /tmp/madlib.78jPYf/array_ops/array_ops.sql_in.tmp
    madpack.py : ERROR : Check the log at /tmp/madlib.78jPYf/array_ops/array_ops.sql_in.log
    madpack.py : INFO : Rolling back the installation...
    madpack.py : INFO : Rollback finished successfully.
    madpack.py : ERROR : MADlib installation failed.
    ```
    Then I change m4 macros in file /usr/local/madlib/Versions/1.9/ports/postgres/9.5/madpack/SQLCommon.m4:
    ```
    -__DBMS_ARCHITECTURE__=
    +m4_define(`__DBMS_ARCHITECTURE__', `x86_64')
    ```
    installation working for me.
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---