Re: Help making a plpgsql function? - Mailing list pgsql-general

From John DeSoi
Subject Re: Help making a plpgsql function?
Date
Msg-id F45625B7-43DD-426B-B500-A3FDE866367D@pgedit.com
Whole thread Raw
In response to Re: Help making a plpgsql function?  (Bjørn T Johansen <btj@havleik.no>)
List pgsql-general
On Jul 5, 2006, at 5:41 PM, Bjørn T Johansen wrote:

> btw, just one more thing...
>
> If I join two or more tables, which type should I use for the
> "into" variable (select into t2 *...) where
> t2 would contain fields from more than one table?
>
> I guess using "t2 some_table%rowtype" won't work when joining tables?


I think you can declare t2 as type record (e.g. "t2 record;" in the
declaration). Alternately, you can declare whatever variables you
need to get from the join and select into them explicitly. Something
like:

select into v1, v2, v3 col1, col2, col3 from t1 join t2 ....



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


pgsql-general by date:

Previous
From: Chander Ganesan
Date:
Subject: Re: High-Availability Question
Next
From: "Jim Cser"
Date:
Subject: Granting COPY TO access