| От | Josh Berkus |
|---|---|
| Тема | Re: root of parent-child table with NOT NULL |
| Дата | |
| Msg-id | web-1392303@davinci.ethosmedia.com обсуждение исходный текст |
| Ответ на | root of parent-child table with NOT NULL constraint (bill@wadley.org) |
| Список | pgsql-novice |
Bill, > The question is: how do I add the first group? The very first group > is > the root group, and doesn't have a parent. > > My choices seem to be to either: > > - create the table without the constraint, add a group that will be > the > parent of all "root" groups, then add the constraint. The problem > with > this solution seems to be that dump and restores will be > problematic. This is exactly what you do, and pg_dump puts the constraints at the end of the file to allow this sort of data load. > So, kind sirs/madams, what am I missing? Well, you should pick up a copy of Joe Celko's "SQL For Smarties" (2nd Ed.), which has 20 pages on tree structures that will save you a lot of headaches. -Josh
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера