From: | Shane Ambler <pgsql(at)Sheeky(dot)Biz> |
---|---|
To: | vladimir konrad <vk(at)dsl(dot)pipex(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: [OT] "advanced" database design (long) |
Date: | 2008-02-02 19:09:03 |
Message-ID: | 47A4BFCF.2090000@Sheeky.Biz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Lewis Cunningham wrote:
> --- vladimir konrad <vk(at)dsl(dot)pipex(dot)com> wrote:
>
>> I think that I understand basic relational theory but then I had an
>> idea.
>> Basically, instead of adding field to a table every time there is a
>> need for it, have a table split in two: one holds identity (id) and
>> one holds the attributes (linked to this id).
>> Basically, if in the future user decides that the subject should
>> have a new attribute, he can simply add "attribute definition" and
>> attribute_definition_set (if any) and the application would handle
>
> Basically, you would be creating your own data dictionary (i.e.
> system catalog) on top of the db data dictionary. The database
> already comes with a way to easily add columns: ddl.
If you have some part of your app that needs to "select" the list of
columns in a table you should look at
http://www.postgresql.org/docs/8.2/interactive/catalogs.html
particularly pg_class and pg_attribute
--
Shane Ambler
pgSQL (at) Sheeky (dot) Biz
Get Sheeky @ http://Sheeky.Biz
From | Date | Subject | |
---|---|---|---|
Next Message | vladimir konrad | 2008-02-02 19:26:54 | Re: [OT] "advanced" database design (long) |
Previous Message | Raymond O'Donnell | 2008-02-02 18:08:15 | Re: first message: SELECT <column> FROM <t |