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

Re: AW: functions returning records

From: "Reinoud van Leeuwen" <reinoud(at)xs4all(dot)nl>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: AW: functions returning records
Date: 2001-06-27 08:56:43
Message-ID: (view raw, whole thread or download thread mbox)
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;

In response to


pgsql-hackers by date

Next:From: Zeugswetter Andreas SBDate: 2001-06-27 09:01:38
Subject: AW: Non-trivial rewriting sql query
Previous:From: Zeugswetter Andreas SBDate: 2001-06-27 08:35:23
Subject: AW: functions returning records

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