     PERFORM UpdateGeometrySRID($7, $1, $2, $4);
   END IF;
 
-  IF idx_name IS NOT NULL
-  THEN
+  IF idx_name IS NOT NULL THEN
     -- recreate spatial index again
-    IF $3 < 3
-    THEN
-      EXECUTE format('CREATE INDEX %I ON %I.%I USING GIST (%I)', idx_name, $7, $1, $2);
-    ELSE
-      EXECUTE format('CREATE INDEX %I ON %I.%I USING GIST (%I gist_geometry_ops_nd )', idx_name, $7, $1, $2);
-    END IF;
+    EXECUTE format('CREATE INDEX %I ON %I.%I USING GIST (%I %I)', idx_name, $7, $1, $2, opclass_param);
   END IF;
 END;
 $$

  ) RETURNS GEOMETRY AS
$$
BEGIN
  IF geom IS NOT NULL
  THEN
    RETURN ST_Transform($1, $2);
  ELSE
    RETURN NULL;

        AND f_geometry_column != 'implicit_geometry'
        AND f_geometry_column != 'relative_other_geom'
        AND f_geometry_column != 'texture_coordinates';
END;
$$
LANGUAGE plpgsql STRICT;