diff --git a/database/pgsql/queries.go b/database/pgsql/queries.go index e9a70efe58..dc91f10bee 100644 --- a/database/pgsql/queries.go +++ b/database/pgsql/queries.go @@ -229,7 +229,8 @@ const ( FROM namespace, feature, ancestry, namespaced_feature, ancestry_layer, ancestry_feature WHERE ancestry.name = $1 AND ancestry.id = ancestry_layer.ancestry_id - AND ancestry_feature.ancestry_layer_id = ancestry_layer.id + AND ancestry_feature.ancestry_layer_id = ancestry_layer.id + AND ancestry_feature.namespaced_feature_id = namespaced_feature.id AND namespaced_feature.feature_id = feature.id AND namespaced_feature.namespace_id = namespace.id`