Github user orhankislal commented on a diff in the pull request:

    https://github.com/apache/madlib/pull/339#discussion_r237604025
  
    --- Diff: src/ports/postgres/modules/kmeans/kmeans.sql_in ---
    @@ -766,15 +766,30 @@ BEGIN
     
         proc_fn_dist := fn_dist
             || '(DOUBLE PRECISION[], DOUBLE PRECISION[])';
    -    IF (SELECT prorettype != 'DOUBLE PRECISION'::regtype OR proisagg = TRUE
    -        FROM pg_proc WHERE oid = proc_fn_dist) THEN
    -        RAISE EXCEPTION 'Kmeans error: Distance function has wrong 
signature or is not a simple function.';
    -    END IF;
    -    proc_agg_centroid := agg_centroid || '(DOUBLE PRECISION[])';
    -    IF (SELECT prorettype != 'DOUBLE PRECISION[]'::regtype OR proisagg = 
FALSE
    -        FROM pg_proc WHERE oid = proc_agg_centroid) THEN
    -        RAISE EXCEPTION 'Kmeans error: Mean aggregate has wrong signature 
or is not an aggregate.';
    +
    +    -- Handle PG11 pg_proc table changes
    --- End diff --
    
    I tried this method but it requires casting `regprocedure` to `varchar`. 
This is allowed on PG versions after 8.3. On earlier versions, we have to use 
`textin` function. This means we will need another if check for GPDB4.3.


---

Reply via email to