Re: Table design - postgresql solution
От | rsmogura@softperience.pl |
---|---|
Тема | Re: Table design - postgresql solution |
Дата | |
Msg-id | 1e6057b14cec13858da1d374f9f1ec5c.squirrel@softperience.eu обсуждение исходный текст |
Ответ на | Table design - postgresql solution (Miguel Vaz <pagongski@gmail.com>) |
Список | pgsql-general |
> Hi, > > I have a bit of a DB design question, associated with postgresql in > particular, hopefully thinking it could solve my dilemma. > > This is my setup of 3 tables: > > Table_1 > id_t1 > name > date_of_discovery > history > > Table_2 > id_t2 > name > type > size > > Table_3 > id_t3 > name > location > color > > I want a solution (table or groups of tables) where i can establish > relations between items of every table, for example: > > row with id=2 from Table_1 is connected to row with id=23 from Table_3 > id=9(from Table_2) is connected to id=83(from Table_1) The common in many to many relations is to create for each two tables "joining" table tab1_tab2 with corresponding foreign keys to tab_1 and tab_2. If you want make general relation table, to keep all relations try with CHECK CONSTRAINT with own function inside.
В списке pgsql-general по дате отправления: