X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D09208B9F8D for ; Thu, 3 Feb 2005 18:12:25 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 63588-03 for ; Thu, 3 Feb 2005 18:12:20 +0000 (GMT) Received: from boutiquenumerique.com (boutiquenumerique.com [82.67.9.10]) by svr1.postgresql.org (Postfix) with ESMTP id 226508B9F21 for ; Thu, 3 Feb 2005 18:12:19 +0000 (GMT) Received: (qmail 13590 invoked from network); 3 Feb 2005 19:12:41 +0100 Received: from unknown (HELO musicbox) (boutiquenumerique-lists@192.168.0.2) by boutiquenumerique.com with SMTP; 3 Feb 2005 19:12:41 +0100 To: "Marc G. Fournier" , "George Weaver" Cc: pgsql-sql@postgresql.org Subject: Re: PL/PgSQL - returning multiple columns ... References: <20050202170643.R27579@ganymede.hub.org> <00c701c50978$f01c9e20$6400a8c0@Dell4500> <20050203124751.C62562@ganymede.hub.org> Message-ID: Date: Thu, 03 Feb 2005 19:15:04 +0100 From: PFC Organization: =?iso-8859-15?Q?La_Boutique_Num=E9rique?= Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In-Reply-To: <20050203124751.C62562@ganymede.hub.org> User-Agent: Opera M2/7.54 (Linux, build 751) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.107 tagged_above=0 required=5 tests=AWL, UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200502/70 X-Sequence-Number: 20181 On Thu, 3 Feb 2005 12:48:11 -0400 (AST), Marc G. Fournier wrote: > > Perfect, worked like a charm ... but the RETURNS still needs to be a > SETOF, other then that, I'm 'away to the races' ... thanks :) No SETOF necessary : CREATE TYPE mytype AS ( number INTEGER, blah TEXT ); CREATE OR REPLACE FUNCTION myfunc( INTEGER ) RETURNS mytype LANGUAGE plpgsql AS $$ DECLARE _retval mytype; BEGIN _retval.number=$1; _retval.blah='yeah'; RETURN _retval; END;$$; SELECT myfunc(22); myfunc ----------- (22,yeah) (1 ligne) SELECT * FROM myfunc(22); number | blah --------+------ 22 | yeah (1 ligne)