Re: Question re: relational technique - Mailing list pgsql-sql

From chester c young
Subject Re: Question re: relational technique
Date
Msg-id 20060312172903.6034.qmail@web54305.mail.yahoo.com
Whole thread Raw
In response to Question re: relational technique  (Robert Paulsen <robert@paulsenonline.net>)
Responses Re: Question re: relational technique
List pgsql-sql
--- Robert Paulsen <robert@paulsenonline.net> wrote:

> One problem with the above is that the list of attributes is fixed. I
> am looking for a way to assign new, previously undefined, attributes
to
> items without changing the table structure. Is it ever appropriate to
do
> the following?
> ...

There are two ways for extending tables, one static and one dynamic.

Your scheme is dynamic.  You will have problems with typing and
performance.  What you really want is to be able to list more
attributes, similar to attributes attached to a tag in html.

If you want a base table that has, under different specified
conditions, extra attributes, there are better techniques.  IMHO the
best solution is, for each condition, create a table containing the
primary table's id plus the extra attributes; then join that to the
base table; then write a view to cover it all; then write rules for
dml.  Sounds difficult but a cake walk once you've done it a few times.



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


pgsql-sql by date:

Previous
From: Weimao Ke
Date:
Subject: Re: pgsql aggregate: conditional max
Next
From: Robert Paulsen
Date:
Subject: Re: Question re: relational technique