I need to split polygons (layer 'pol') by both closed and non-closed linestrings (layer 'lin').
Unfortunately I don't get proper results running the following query.
CREATE VIEW splitted_pol AS SELECT g.path as gid, g.geom::geometry(polygon, SRID) as geom FROM (SELECT (ST_Dump(ST_Split(pol.geom, lin.geom))).* FROM pol, lin ) as g;
In my example ST_Split should create six polygons (layer 'splitted_pol').
Does anybody know how to use ST_Split with QGIS/PostGIS?