Hi, Does anyone know weather functions using a CTE require parrarell restricted instead of safe? I find conflicting information online so I am not sure. And it isn't documented in the updated postgres docs The Postgres manual states that scans of CTEs are parallel restricted. However a PL/pgSQL function is an encapsulated black box. If a parallel worker is assigned to execute a PARALLEL SAFE function, it executes the entire function locally within its own private memory context. When it encounters a CTE inside that function, it just executes it serially in its own memory.
The user is seeking clarification on whether functions using a CTE in PL/pgSQL require 'parallel restricted' instead of 'safe'. They mention finding conflicting information online and note a lack of documentation in the updated Postgres docs.