Received: from customer-relay-1.mail.uksolutions.net (customer-relay-1.mail.uksolutions.net [217.10.128.165]) by postgresql.org (8.11.3/8.11.4) with SMTP id g182DdE88288 for ; Thu, 7 Feb 2002 21:13:40 -0500 (EST) (envelope-from vince@ukshells.co.uk) Received: (qmail 14693 invoked from network); 8 Feb 2002 02:13:32 -0000 Received: from unknown (HELO majestic.ukshells.co.uk) (217.10.142.170) by customer-relay-1.mail.uksolutions.net with SMTP; 8 Feb 2002 02:13:32 -0000 Received: (qmail 14508 invoked by uid 8102); 8 Feb 2002 02:13:32 -0000 Date: Fri, 8 Feb 2002 02:13:32 +0000 From: Vincent AE Scott To: pgsql-sql@postgresql.org Subject: Re: How do you return more than one variable in a plpgsql function? Message-ID: <20020208021332.W25018@majestic.ukshells.co.uk> References: <3C62E6FC.1040208@kepnet.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3us In-Reply-To: <3C62E6FC.1040208@kepnet.net> X-Arbitrary-Number-Of-The-Day: 42 X-Operating-System: Linux 2.4.16 i686 X-Favourite-Cigar-Size: Double Corrona X-Phase-of-the-Moon: Looking good ground control X-Apparently-From: io X-Complaints-To: /dev/null X-Fnord: +++ath X-Message-Flag: Message text blocked: ADULT LANGUAGE/ENTERTAINMENT X-Archive-Number: 200202/92 X-Sequence-Number: 6520 Mark Nielsen(python@kepnet.net)@Thu, Feb 07, 2002 at 03:43:40PM -0500: > I have never figured out how to make a plpgsql function return more than > one variable or type. I read something where a function an return an > open cursor, but I never figured out how. I want a function to be able > to return an entire row of a table or a number of fields from different > tables using plpgsql. > > How can I do that? > Thanks! > Mark i'm certainly no expert on postgres, but one option i can think of, would be to insert the data into a 'temporary' table. then return the unique ID for that data. certainly not perfect, but flexible. HTH, -vince -- PGP key: http://codex.net/pgp/pgp.asc Computers make very fast, very accurate mistakes.