You can regularly query your queries written with the Common Table Expression by converting them to Recursive View.
We have already done an example of Common Table.
You can find the details in the article titled “How To Create a CTE(Common Table Expression) in PostgreSQL”.
With the help of the following script, we can convert the CTE we created in the previous article into a recursive view.
CREATE RECURSIVE VIEW Recursive_View_Example(name,employeeid,managerid,title) AS
select name,employeeid,managerid,title from employee
select e.name,e.employeeid,e.managerid,e.title from employee e join Recursive_View_Example
You can also query the recursive view as follows.
select * from Recursive_View_Example;
You may want to look at the following articles about Views.