Thread: Temp Tables

Temp Tables

From
Brandon E Hofmann
Date:
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?  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.

Any help would be greatly appreciated.

Thanks,

Brandon


Re: Temp Tables

From
"William Leite Araújo"
Date:
2006/5/25, Brandon E Hofmann <Brandon_E_Hofmann@notes.ntrs.com>:

(..)
I tried defining composite types, but get a runtime error that it isn't
available.

     That is you postgres
--
William Leite Araújo
Especialista em Geoprocessamento    - UFMG
Bacharel em Ciêncida da Computação - UFMG
MSN:  ufmgwil@yahoo.com.br
ICQ:    222159351
GTalk: william.bh@gmail.com
Yahoo: ufmgwil@yahoo.com.br
Skype: william.bh

Re: Temp Tables

From
"William Leite Araújo"
Date:
2006/5/25, Brandon E Hofmann <Brandon_E_Hofmann@notes.ntrs.com>:

(..)
I tried defining composite types, but get a runtime error that it isn't
available.

     That is you postgresql version?
 
     Why you need return the temporary table type? Why create a temporary table if you use a function return type "setof"?
    
--
William Leite Araújo