I use the following method which is not session dependent (and therefore not as as complicated as your requirement):
Define a model for the query Drop the table before the query is executed Use Postgresql's 'SELECT INTO' or 'CREATE TABLE AS XXX FROM' in the query to populate the table. Maybe in your case one can use a conditional model which uses the session-id in the table's name, execute the query and drop it after the session has ended. I don't know whether it is possible. Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) --