Re: many-to-many relationship
| От | Louis-David Mitterrand |
|---|---|
| Тема | Re: many-to-many relationship |
| Дата | |
| Msg-id | 20081008092510.GA23361@apartia.fr обсуждение исходный текст |
| Ответ на | many-to-many relationship (Louis-David Mitterrand <vindex+lists-pgsql-sql@apartia.org>) |
| Список | pgsql-sql |
On Tue, Oct 07, 2008 at 05:16:39PM -0700, Steve Midgley wrote: > > I think the relationship tables method works pretty well but I have > another suggestion. You could store the Foreign table name within image > table as well as the Foreign key. > > |id|image_url|f_table|f_key > |1 |url......|person |1234 > |2 |url2.....|event |5678 > > I think this is called a "polymorphic join" but I could be wrong about > that. I'd guess you could construct a rule or trigger to validate the > foreign key data on insert/update but that's out of my skill area. Hi Steve, So in your solution the f_table column is just text which needs to be validated by a custom trigger? -- http://www.lesculturelles.net
В списке pgsql-sql по дате отправления: