On Tuesday, June 9, 2020 at 11:04:30 AM UTC-7, Jason Landry wrote:
>
> I recently starting using this plugin and is absolutely fantastic for my 
> needs.  I mean seriously incredibly awesome.
>
> I do have an issue that I am trying to work around -- not an issue with 
> the code, but with the data we feed in.
>
> In a few cases, we have some "legacy" data that has the child id = parent 
> id  (we don't use PK's for this, long story, I am working with what I have 
> :)  )
>
> This of course causes a cyclic redundancy, and it does it right within the 
> CTE itself.
>
> I can handle this by excluding the row in my query but I'd like to make 
> sure it can't happen at all.  Is there any way to add a `where` clause to 
> both selects in CTEs UNION select?  I basically never want to include where 
> the join a parent has the same value as a child.
>
> The data will get cleaned up, but it does make me worry a bit about other 
> similar issues.
>

The rcte_tree plugin currently expects that roots have a NULL parent_id.  
We could probably support an option that also considered child_id = 
parent_id the same as NULL parent_id.  I'll take a look at the plugin and 
see how difficult that would be.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/fb37f75d-6ec7-444a-8de1-eb643b343fdbo%40googlegroups.com.

Reply via email to