Closed SPlanzer closed 3 years ago
WHERE g.feat_id = g.feat_id
is definitely wrong, as it will always be true. I don't know enough of the query to know if we can use NEW.feat_id or something like that. All those subselects surely look dangerous (and expensive, performance-wise).
Having tests in place would greatly help :)
That's the problem we can not use NEW.feat_id
WHERE g.feat_id = g.feat_id
was a mistake and PR #166 is to resolve this
I understand the sub queries are expensive - It is however a workflow that is not used heavily.
The error
PostGIS error while adding features: ERROR: more than one row returned by a subquery used as an expression
is on insert of new geom.This is via the newly edited rules that now return (see below)
When creating the rule the where clause is not as expected.
WHERE g.feat_id = feat_id
>WHERE g.feat_id = g.feat_id
Note: the addition of theg.
will result in multiple rows being returned.Below code to create the rule
The rule definition once installed in the DB