Using jOOQ 3.11.2 and Postgres 9.4, I am trying to re-use one jOOQ CTE in the definition of a second CTE.
The following is incorrect per StackOverflow question How
I am answering my own question. As of 1 Jan 2020, it was not possible to chain the CTEs. As I noted in the comments, the workaround was to use temp database tables. In my case that was a code smell. In the end I solved the bigger problem, simplified my code and did not need to solve chaining CTEs.
If you do use temp tables, remember to delete the tables when no longer needed to prevent database clutter.
Note that jOOQ is a well maintained evolving library and in later versions this might be added.