pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kai Hessing <kai.hessing@hobsons.de>
To: pgsql-sql@postgresql.org
Subject: can a function return a virtual table?
Date: Wed, 13 Apr 2005 15:44:25 +0200
Message-ID: <3c4m1vF6b6e6aU1@individual.net> (raw)

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.)



view thread (6+ messages)  latest in thread

Message-ID: <3c4m1vF6b6e6aU1@individual.net>
Permalink:  ../3c4m1vF6b6e6aU1@individual.net/
Also on:    postgresql.org/message-id/3c4m1vF6b6e6aU1@individual.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: kai.hessing@hobsons.de
  Subject: Re: can a function return a virtual table?
  In-Reply-To: <3c4m1vF6b6e6aU1@individual.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox