Return-Path: owner-postman
Received: from localhost (localhost [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with SMTP id XAA28231 for postgres-dist; Wed, 10 Nov 1993 23:06:23 -0800
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199311110706.XAA28231@nobozo.CS.Berkeley.EDU>
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from faerie.CS.Berkeley.EDU (faerie.CS.Berkeley.EDU [128.32.149.14]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with ESMTP id XAA28222 for <postgres@nobozo.CS.Berkeley.EDU>; Wed, 10 Nov 1993 23:06:23 -0800
Received: from localhost (localhost [127.0.0.1]) by faerie.CS.Berkeley.EDU (8.6.3/8.1B) with SMTP id XAA28778; Wed, 10 Nov 1993 23:06:20 -0800
Message-Id: <199311110706.XAA28778@faerie.CS.Berkeley.EDU>
X-Authentication-Warning: faerie.CS.Berkeley.EDU: Host localhost didn't use HELO protocol
From: aoki@postgres.Berkeley.EDU (Paul M. Aoki)
To: "Richard M. Bennema" <rmbenn@david.wheaton.edu>
Cc: postgres@postgres.Berkeley.EDU
Subject: Re: Alias Functions 
In-reply-to: Your message of Wed, 10 Nov 1993 20:24:23 -0600 (CST) 
	     <199311110224.AA12997@david.wheaton.edu> 
Date: Wed, 10 Nov 93 23:06:20 -0800
X-Sender: aoki@postgres.Berkeley.EDU
Resent-To: postgres-dist@postgres.Berkeley.EDU
X-Mts: smtp
Resent-Date: Wed, 10 Nov 93 23:06:23 -0800
Resent-XMts: smtp

"Richard M. Bennema" <rmbenn@david.wheaton.edu> writes:
> Section 7.1 on page 10 describes defining functions to be used as "aliases" for
> commonly-used queries.  We have had no problem defining the function, but we
> haven't been able to make it very useful.

i think it's safe to say that the manual description is bogus.
functions are not supposed to be aliases in the same sense as shell
aliases.. they do not "extend" the syntax by some kind of preprocessing.
think of them as, well, functions.  functions are used as part of
other expressions, which implies that they are used in target lists 
and qualifications, which implies that they must be part of a
retrieve/replace/append/delete query.  hence..

> Is there a way to call an alias function without having to type out a retrieve
> statement every time?

no.

> If there is not, is there any way to get multiple columns
> returned instead of only one?

foo.bar.all/all(bar(foo)) does not expand as it does for un-nested
expressions (foo.all).  this will probably change sometime since .all
is too useful.  foo.bar.a, foo.bar.b should work; carol paxson recently 
found (and fixed) a bug in the executor such that it would not if a and 
b had different types.
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  aoki@postgres.Berkeley.EDU
                |  Berkeley, CA 94720           |  ...!uunet!ucbvax!aoki
