Search Postgresql Archives

Table filter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux