temp tables in functions?

From: "jws" <jsacksteder(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: temp tables in functions?
Date: 2007-02-08 04:40:09
Message-ID: 1170909609.908314.91930@q2g2000cwa.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Having developed a complex query, I want to wrap it up as a function
so that it can take a parameter and return a set of rows. This query
is currently written as multiple sql statements that create a few
interstitial temp tables that are then joined. If I put this into a
function definition, do those temp tables get dropped automatically
when the function returns?

My alternative is to re-write the query as a self joins and
subqueries. I can do that, but it's somewhat less readable.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jan Mura 2007-02-08 04:43:14 SQL textbook
Previous Message jws 2007-02-08 04:33:41 Re: 'greatest' function?