pgAdmin4: How do I edit the SELECT query generated by "View/Edit Data > All Rows"?

Solution 1:

The View/Edit Data page is just a limited version of the Query Tool, according to pgAdmin's documentation1:

The Query Tool and View/Edit Data tools are actually different operating modes of the same tool. Some controls will be disabled in either mode. Please see The Query Tool Toolbar for a description of the available controls.

So use Query Tool (accessible from the same context menu) instead of using View/Edit Data. You can edit the query there.