]> granicus.if.org Git - postgis/commitdiff
#2405 fix handling of the newer create aggregate syntax
authorNicklas Avén <nicklas.aven@jordogskog.no>
Tue, 6 Aug 2013 19:19:50 +0000 (19:19 +0000)
committerNicklas Avén <nicklas.aven@jordogskog.no>
Tue, 6 Aug 2013 19:19:50 +0000 (19:19 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@11740 b70326c6-7e19-0410-871a-916f4a2858ee

utils/postgis_proc_upgrade.pl

index 7dcd9e2b2c164cd51182152581b8f390da4b76b5..99bcbe5448517105e7e1f41a8da44ecd9421a90b 100755 (executable)
@@ -227,7 +227,16 @@ while(<INPUT>)
                        $aggtype = $1 if ( /basetype\s*=\s*([^,]*)\s*,/i );
                        last if /\);/;
                }
-               print "DROP AGGREGATE IF EXISTS $aggname($aggtype);\n";
+               if ($aggtype=='unknown')
+               {
+               #For the new aggregate syntax where the parameters is defined like a common function
+                       print "DROP AGGREGATE IF EXISTS $aggname;\n";
+               }
+               else
+               {
+               #For the old syntax when the parameter is defined through "basetype"
+                       print "DROP AGGREGATE IF EXISTS $aggname($aggtype);\n";
+               }
                print $def;
        }