Skip site navigation (1) Skip section navigation (2)

AW: AW: functions returning records

From: Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at>
To: "'Reinoud van Leeuwen'" <reinoud(at)xs4all(dot)nl>, pgsql-hackers(at)postgresql(dot)org
Subject: AW: AW: functions returning records
Date: 2001-06-27 09:17:57
Message-ID: 11C1E6749A55D411A9670001FA687963368350@sdexcsrv1.f000.d0188.sd.spardat.at (view raw or flat)
Thread:
Lists: pgsql-hackers
> >>  For the result from foo() you must somewhere define attributes (names). 
> >> Where? In CREATE FUNCTION statement? Possible must be:
> >> 
> >>  select name1, name2 from foo() where name1 > 10;
> > 
> > Yes, optimal would imho also be if the foo() somehow had access to the
> > where restriction, so it could only produce output, that the
> > higher level is interested in, very cool. This would be extremely 
> > useful for me. Very hard to implement, or even find an appropriate 
> > interface for though.
> 
> You could easily implement it *in* the function foo IMHO. Since the 
> function does some black magic to create the result set to begin with, you 
> can change it to use parameters:
> 
> select name1, name2 from foo(10, NULL, NULL) where name1 > 10;

Yes, but this is only an answer to a limited scope of the problem at hand,
and the user who types the select (or uses a warehouse tool) needs substantial 
additional knowledge on how to efficiently construct such a query.

In my setup the function would be hidden by a view.

Andreas

Responses

pgsql-hackers by date

Next:From: Karel ZakDate: 2001-06-27 09:39:57
Subject: Re: AW: functions returning records
Previous:From: Zeugswetter Andreas SBDate: 2001-06-27 09:08:06
Subject: AW: Benchmarking

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group