Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 93AE762698E for ; Mon, 16 Apr 2012 17:11:46 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SJsH1-0002YM-Hh for pgsql-bugs@postgresql.org; Mon, 16 Apr 2012 20:11:45 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q3GKBThq004380; Mon, 16 Apr 2012 16:11:29 -0400 (EDT) To: Bill MacArthur cc: pgsql-bugs@postgresql.org Subject: Re: TYPE of TEMP table does not seem to get set In-reply-to: <4F8C771A.2040509@dhs-club.com> References: <4F8C771A.2040509@dhs-club.com> Comments: In-reply-to Bill MacArthur message dated "Mon, 16 Apr 2012 15:46:34 -0400" Date: Mon, 16 Apr 2012 16:11:29 -0400 Message-ID: <4379.1334607089@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201204/104 X-Sequence-Number: 32855 Bill MacArthur writes: > I have a view "configurations.tp_transactions" which is a blend of many tables using INNER and LEFT JOINs. I want to populate a temp table from which I can obtain the data and programmatically write queries to operate on that data using certain PLPGSQL functions in a uniform fashion. I have several functions which all expect a single argument of the type "configurations.tp_transactions". I think you would need to create the temp table as a child of the main table for this to work. As you're doing it, the rowtype of the temp table is independent of the main (and the fact that they happen to have the same columns is NOT good enough to make it acceptable to a function declared to take the main table's rowtype). regards, tom lane