can a function return a virtual table? - Mailing list pgsql-sql

From Kai Hessing
Subject can a function return a virtual table?
Date
Msg-id 3c4m1vF6b6e6aU1@individual.net
Whole thread Raw
Responses Re: can a function return a virtual table?  (Michael Fuhr <mike@fuhr.org>)
Re: can a function return a virtual table?  (Josh Berkus <josh@agliodbs.com>)
List pgsql-sql
This is the question i'm telling myself. It is because we don't really
delete table entries, just setting a status field to '-1'. So a valid
select would look like: SELECT xyz, abc FROM (SELECT * FROM tablex WHERE
status > -1);
It would be much nicer to have to write something like: SELECT xyz, abc
FROM active(tablex); where the function 'active(x)' returns a virtual
table with all entries from table x where status is > -1. But sadly I
have no idea how write such a function. Good old O'reilly can't help (or
i'm to dumb *g*).



-- 
GnuPG-PublicKey -> http://www.hobsons.de/pgp/kai_hessing.asc

Bei seinen Handlungen ist vorzubedenken besser als nachzubedenken.
(Demokrit, um 460 v. Chr.)


pgsql-sql by date:

Previous
From: "Matt Fulford"
Date:
Subject: SQL subquery (count distinct) - Any Ideas?
Next
From: Rod Taylor
Date:
Subject: Re: Getting the output of a function used in a where clause