You could create a temporary table, visible only to the current client, from the results of a query, work on that table to your heart's content, then drop the table (or let it be dropped automatically when the connection closes). For example:
CREATE TEMPORARY TABLE T AS SELECT fields FROM tables WHERE conditions;
...
queries on table T
...
DROP TABLE T;