Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3UFSe321658 for ; Mon, 30 Apr 2001 11:28:40 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f3UFSbR15159; Mon, 30 Apr 2001 11:28:38 -0400 (EDT) To: "Eliel Mamousette" cc: pgsql-general@postgresql.org Subject: Re: SQL Server -> Postgres migration: Stored Procedure replacement? In-reply-to: <000401c0d0ce$f3081f10$2001a8c0@blockhead> References: <000401c0d0ce$f3081f10$2001a8c0@blockhead> Comments: In-reply-to "Eliel Mamousette" message dated "Sun, 29 Apr 2001 13:08:02 -0400" Date: Mon, 30 Apr 2001 11:28:37 -0400 Message-ID: <15156.988644517@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200104/1240 X-Sequence-Number: 8557 "Eliel Mamousette" writes: > I have tried using the SETOF operand in the CREATE FUNCTION > statement, and that allows me to return more than one row, > but haven't had any luck with specifying more than one return > type and hence more than one column. You don't specify more than one return type --- you specify one return type that is a composite type. Composite types are currently tied to tables; creating a table also creates a type that represents one of its rows. Thus create table foo (a int, b int); create function foobar (...) returns foo as ... Note that there are some annoying syntactic limitations on what you can actually *do* with a function returning tuples. We have plans to improve that situation in 7.2 or beyond, but for now, this facility isn't nearly as useful as one might think. regards, tom lane