"Doug Thom" <dthom@iagr.net> writes:
> So I would be doing something like:
> --Do the thing that builds the query.
> Select query
> Into query-string
> From table-that-has-query;
> Open cursor for query-string;
> Return cursor;
> --End pseudo code
I think you're looking for OPEN cursor FOR EXECUTE in plpgsql.
See the "cursor operations" part of the plpgsql manual.
regards, tom lane