Please help!

From: Brandon E Hofmann <Brandon_E_Hofmann(at)notes(dot)ntrs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Please help!
Date: 2006-06-13 16:08:50
Message-ID: OF75FBA183.6B9226FE-ON8625718C.00570A36-8625718C.0058C575@notes.ntrs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


When using a temp table in plpgsql functions that has columns comprised
from many tables populated by joins, how do you specify a temp table return
type when its generated by select into and dropped dynamically? I get an
error when I specify returns setof temp_table. Also when I specify a
permanent table as the return type, I get extra blank columns in the result
set which are the additional columns of the permanent table I don't need
and the data is displayed in the wrong columns.

I tried defining composite types, but get a runtime error that it isn't
available unless I first define it outside of the function. Since requests
are dynamic, its impossible for me to determine all possible composite
types required ahead of time.

In plpgsql, how do you return back a result set that is determined and
generated at runtime based on a report request? Also why does plpgsql
require you to define what is returned?

I'm relatively new to PostgreSQL and really impressed by its capabilities.
Do you have any examples showing how to define and return a dynamic result
set at runtime within a function?

I tried posting these questions to the general mailing list, but didn't
receive any feedback. Any help would be greatly appreciated.

Thanks,

Brandon

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Steve Atkins 2006-06-13 16:10:25 Re: CSV mode option for pg_dump
Previous Message Tom Lane 2006-06-13 15:51:25 Re: timezones to own config file