Table filter

From: Reg Me Please <regmeplease(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Table filter
Date: 2007-11-21 14:21:57
Message-ID: 200711211521.57818.regmeplease@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all.

I've the following concept.

create table t_data
( property text,
item int8,
prop_value text
);

(I've cut some fields away needed only for data history).
The meaning is that an entity called by the value of "item" has a number
of properties called by "property" with value "prop_value".
So, for a single "item" there can be many different "property" each with its
own value.

create table t_filters
( filter text
);

create table t_filter_def
( filter text references t_filters,
property text,
prop_value l text
);

A filter is a list of property values needed to qualify an entity as
"good". An entity evaluates as good only when all property values in the
filter match the ones associated to an item in t_data.

What's missing to me is how to apply a filter to the t_data and get the list
of the items that evaluate good.

--
Reg me Please
<Non quietis maribus nauta>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Browne 2007-11-21 14:53:25 Re: select with recursive support
Previous Message Scott Marlowe 2007-11-21 13:48:50 Re: Restart a sequence regularly