I need to split polygons (layer 'pol') by both closed and non-closed linestrings (layer 'lin').

![enter image description here](https://i.stack.imgur.com/H0Lz4.png)
![enter image description here](https://i.stack.imgur.com/NaxnJ.jpg)

Unfortunately I don't get proper results running the following query.

```
CREATE VIEW splitted_pol AS
SELECT 
    g.path[1] 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').

![enter image description here](https://i.stack.imgur.com/SWSVh.png)
![enter image description here](https://i.stack.imgur.com/PivR8.jpg)
 Does anybody know how to use ST\_Split with QGIS/PostGIS?