Received: from mail2.panix.com (mail2.panix.com [166.84.0.213]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f42MxhA12423 for ; Wed, 2 May 2001 18:59:43 -0400 (EDT) (envelope-from eliel@panix.com) Received: from blockhead (eliel.dialup.access.net [166.84.205.53]) by mail2.panix.com (Postfix) with SMTP id 4E73C8F1D; Wed, 2 May 2001 18:59:29 -0400 (EDT) From: "Eliel Mamousette" To: Cc: "Tom Lane" Subject: RE: SQL Server -> Postgres migration: Stored Procedure replacement? Date: Wed, 2 May 2001 18:57:14 -0400 Message-ID: <000601c0d202$203b2b10$2001a8c0@blockhead> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: <15156.988644517@sss.pgh.pa.us> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal X-Archive-Number: 200105/47 X-Sequence-Number: 8680 "Tom Lane" writes: > "Eliel Mamousette" 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 >