On Dec 4, 2011, at 22:28, Maxim Boguk <maxim.bo...@gmail.com> wrote:

> Hi.
> 
> Is here any way to combine WITH and WITH RECURSIVE into single query?
> 
> Something like:
> 
> WITH t AS (some complicated select to speed up recursive part),
> RECURSIVE r AS 
> (
> ...
> UNION ALL
> ...
> )
> 
> ?
> 
> -- 
> Maxim Boguk
> Senior Postgresql DBA.

WITH RECURSIVE q1 As (), q2 AS () ...

Add RECURSIVE after the WITH; it then applies to any/all the CTEs.

Look at the specification (and description) in the SELECT documentation closely.

David J.
-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to