EDITs
After some word exchanges with JGH (see comments below) I've noticed that testing the query without the WHERE
statement is giving encouraging results:
But then, when trying to actually "Add" the layer, QGIS freezes and is no more responsive. I have to kill it (tried to wait 20min or so, where the query returns less than 10 small polygons within psql or pgAdmin4).
On the other hand, when the WHERE
statement is present, pressing the "Test" button itself makes QGIS unresponsive, the "No error" popup window never comes on the screen and I have to kill the program.
The behaviour is the same in every cases, having the "Embedded Layers" selected or not (in every cases, the required layers are already in the table of content of my project).
Follow up there: Adding a Virtual Layer makes QGIS unresponsive but the test of the query says "No error"