pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Eliel Mamousette <eliel@panix.com>
To: pgsql-general@postgresql.org
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Subject: RE: SQL Server -> Postgres migration: Stored Procedure replacement?
Date: Wed, 2 May 2001 18:57:14 -0400
Message-ID: <000601c0d202$203b2b10$2001a8c0@blockhead> (raw)
In-Reply-To: <15156.988644517@sss.pgh.pa.us>

"Tom Lane" <sss.pgh.pa.us> writes:
> "Eliel Mamousette" <eliel@panix.com> writes:
[question re: returning rows deleted to conserve bits]
> 
> 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, c int);
> 	create function foobar (...) returns foo as ...

Does rule also apply to views?

For example, what is the best practice when one doesn't want to return
a whole row?  Given the restriction as stated, if I only wanted to
return column a and c from the table above, would I create a view
fooview and then say that function foobarview returns fooview?

If I write a paragraph about this process, to whom should I mail it for
inclusion in the documentation?  I imagine it will be a FAQ for we who
are striving to escape from the legacy of Sybase and Microsoft's SQL
Server....

> 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.

Thanks Tom, but can you be a bit more specific about what one can't do
with returned tuples?  It might save some folks (and me) some time.

thanks again, this process has been extremely helpful,
	eliel

> 			regards, tom lane
> 




view thread (4+ messages)  latest in thread

Message-ID: <000601c0d202$203b2b10$2001a8c0@blockhead>
Permalink:  ../000601c0d202$203b2b10$2001a8c0@blockhead/
Also on:    postgresql.org/message-id/000601c0d202$203b2b10$2001a8c0@blockhead

 · 

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: eliel@panix.com, pgsql-general@postgresql.org, tgl@sss.pgh.pa.us
  Subject: Re: SQL Server -> Postgres migration: Stored Procedure replacement?
  In-Reply-To: <000601c0d202$203b2b10$2001a8c0@blockhead>
  References: <15156.988644517@sss.pgh.pa.us> <000601c0d202$203b2b10$2001a8c0@blockhead>

* 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