Re: [HACKERS] Combine non-recursive and recursive CTEs?

2012-06-16 Thread Magnus Hagander
On Sat, Jun 16, 2012 at 2:52 PM, Tom Lane wrote: > Magnus Hagander writes: >> Basically, I'd like to combine a recursive and a non-recursive CTE in >> the same query. > > Just mark them all as recursive.  There's no harm in marking a CTE as > recursive when it isn't really. Hah. I could've sworn

Re: [HACKERS] Combine non-recursive and recursive CTEs?

2012-06-15 Thread Tom Lane
Magnus Hagander writes: > Basically, I'd like to combine a recursive and a non-recursive CTE in > the same query. Just mark them all as recursive. There's no harm in marking a CTE as recursive when it isn't really. > Trying something like: > WITH t1 (z,b) AS ( >SELECT a,b FROM x > ), > RECU

Re: [HACKERS] Combine non-recursive and recursive CTEs?

2012-06-15 Thread PostgreSQL - Hans-Jürgen Schönig
On Jun 16, 2012, at 8:27 AM, Magnus Hagander wrote: > I'm not sure if this is something I don't know how to do, or if it's > something we simply can't do, or if it's something we could do but the > syntax can't handle :-) > > Basically, I'd like to combine a recursive and a non-recursive CTE in >