![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm especially interested on your take of my use of arrays. They avoid the need for additional tables, but maybe they are not good, nevertheless? BTW, what I'm really missing is as a newbie is a way to define new data types as "structures" as known from e.g. the C programming language (or is this supported by PostgreSQL?). That would IMHO be a more natural concept for storing data (for example, then I could create an array of addresses for each contact). |
#3
| |||
| |||
|
|
...I bluntly ask you to criticize the design attached below... I'm especially interested on your take of my use of arrays. They avoid the need for additional tables, but maybe they are not good, nevertheless? |
|
BTW, what I'm really missing is as a newbie is a way to define new data types as "structures" as known from e.g. the C programming language (or is this supported by PostgreSQL?). That would IMHO be a more natural concept for storing data (for example, then I could create an array of addresses for each contact). |
#4
| ||||
| ||||
|
|
[arrays are bad] I know you are under "temporal pressure" but this is truely a case of "pay me now or pay me later". |
|
By way of example, say you want to write a query showing all contacts for a particular location. With an array of 0..n location elements that is very hard to do. |
|
You may want to check out "Database Design for Mere Mortals". |
|
[An example for a contacts scheme] |
#5
| |||
| |||
|
|
"Major" tables: ORGANIZATIONS: contact_id, offers, demands, description, type (person|non-person), type_id (a person_id or a non-person_id) |
|
PERSONS: person_id, surname, given_names, pseudonyms, prefix, suffix, sex (M|F) |
|
NON-PERSONS: non-person_id, name, type (company|non-profit|...) |
#6
| |||
| |||
|
|
I forgot to create a relation that reflects that a person/non-person is an organization: |
|
"Major" tables: ORGANIZATIONS: contact_id, offers, demands, description, type (person|non-person), type_id (a person_id or a non-person_id) |
#7
| |||
| |||
|
|
The new draft: "Major" tables: ORGANIZATIONS: contact_id, offers, demands, description, type (person|non-person), type_id (a person_id or a non-person_id) |
|
PERSONS: person_id, surname, given_names, pseudonyms, prefix, suffix, sex (M|F) NON-PERSONS: non-person_id, name, type (company|non-profit|...) |
#8
| |||
| |||
|
|
I forgot to create a relation that reflects that a person/non-person is an organization: On Thu, 15 Jul 2004 16:25:54 +0200 Felix E. Klee wrote: "Major" tables: ORGANIZATIONS: contact_id, offers, demands, description, type (person|non-person), type_id (a person_id or a non-person_id) contact_id should be substituted by organization_id. |
|
PERSONS: person_id, surname, given_names, pseudonyms, prefix, suffix, sex (M|F) The field organization is missing. |
|
NON-PERSONS: non-person_id, name, type (company|non-profit|...) The field organization is missing. |
#9
| |||
| |||
|
|
"Major" tables: ORGANIZATIONS: contact_id, offers, demands, description, type (person|non-person), type_id (a person_id or a non-person_id) contact_id should be substituted by organization_id. That doesn't sound right. |
|
This table looks a lot like a contact table. Unless there is exactly one contact per organzation you probably want two tables. |
![]() |
| Thread Tools | |
| Display Modes | |
| |