[GENERAL] How best to represent relationships in a database generically?

2007-07-27 Thread Lincoln Yeoh
Hi, Sorry, this really isn't postgresql specific, but I figure there are lots of smarter people around here. Say I have lots of different objects (thousands or even millions?). Example: cow, grass, tiger, goat, fish, penguin. BUT I'm not so interested in defining things by linking them to

Re: [GENERAL] How best to represent relationships in a database generically?

2007-07-27 Thread Ted Byers
Here are just a few observations. What you have described is a classic taxonomy problem. The simplest approach is to create a table to contain the basic attributes of the obtjects in the database. Using your example, such attributes may be anatomical (two eyes, two ears, four limbs, one

Re: [GENERAL] How best to represent relationships in a database generically?

2007-07-27 Thread Edward Macnaghten
Lincoln Yeoh wrote: Hi, importantly do searches and other processing by those relationships. So, what would be the best way to store them so that a search for the relationship like grass is to cow, will also turn up cow is to tiger, and goat is to tiger, and fish is to penguin (and penguin is