pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Eliel Mamousette <eliel@panix.com>
Cc: pgsql-general@postgresql.org
Subject: Re: SQL Server -> Postgres migration: Stored Procedure replacement?
Date: Mon, 30 Apr 2001 11:28:37 -0400
Message-ID: <15156.988644517@sss.pgh.pa.us> (raw)
In-Reply-To: <000401c0d0ce$f3081f10$2001a8c0@blockhead>
References: <000401c0d0ce$f3081f10$2001a8c0@blockhead>

"Eliel Mamousette" <eliel@panix.com> 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



view thread (4+ messages)  latest in thread

Message-ID: <15156.988644517@sss.pgh.pa.us>
Permalink:  ../15156.988644517@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15156.988644517@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, eliel@panix.com, pgsql-general@postgresql.org
  Subject: Re: SQL Server -> Postgres migration: Stored Procedure replacement?
  In-Reply-To: <15156.988644517@sss.pgh.pa.us>
  References: <000401c0d0ce$f3081f10$2001a8c0@blockhead> <15156.988644517@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox