X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id D46C3D1B47C for ; Fri, 2 Jan 2004 02:11:09 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 75865-07 for ; Thu, 1 Jan 2004 22:10:23 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id B7AE1D1B479 for ; Thu, 1 Jan 2004 22:10:19 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id i022AL19002410; Thu, 1 Jan 2004 21:10:21 -0500 (EST) To: beyaRecords - The home Urban music Cc: pgsql-sql@postgresql.org Subject: Re: Stored procedures In-reply-to: <08C87AE5-3CC6-11D8-AB42-0003938366A4@beya-records.com> References: <08C87AE5-3CC6-11D8-AB42-0003938366A4@beya-records.com> Comments: In-reply-to beyaRecords - The home Urban music message dated "Fri, 02 Jan 2004 01:50:25 +0000" Date: Thu, 01 Jan 2004 21:10:21 -0500 Message-ID: <2409.1073009421@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/2 X-Sequence-Number: 16395 beyaRecords - The home Urban music writes: > I am having problems with a stored procedure (plpgsql) that takes in a > value and returns a record set. > I am calling the procedure as follows: > select clientRec('tmpg60'); Use select * from clientRec('tmpg60') as (column list); If you declare the function as returning RECORD, you will need to provide an AS clause that identifies the column set the records will contain. Without this, the parser has no idea what to expand "*" to. See the example in section 7.2.1.4 here: http://www.postgresql.org/docs/7.4/static/queries-table-expressions.html regards, tom lane