Site icon Database Tutorials

How To Create a Recursive View On PostgreSQL

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.

 

You can also query the recursive view as follows.

 

You may want to look at the following articles about Views.

How To Create a View On PostgreSQL“,

How To Create a Materialized View On PostgreSQL“,

How To Create an Updateable View On PostgreSQL“,

How To Create an Updateable View WITH CHECK CONSTRAINT On PostgreSQL

 

Exit mobile version