Re: Check Constraints and pg_dump
От | Tom Lane |
---|---|
Тема | Re: Check Constraints and pg_dump |
Дата | |
Msg-id | 11619.1077803699@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Check Constraints and pg_dump (Jonathan Scott <jwscott@vanten.com>) |
Ответы |
Re: Check Constraints and pg_dump
Re: Check Constraints and pg_dump |
Список | pgsql-hackers |
Jonathan Scott <jwscott@vanten.com> writes: > The functions and tables create just fine, but when it gets to the > COPY part of the sql script, it tries to load tables in what really is > the wrong order. The check constraint is making sure there is a "plan" > before there is a "contract", yet pg_dump is trying to load the > contract table before there is anything in the plan table. Shouldn't you be using a foreign key for that? I don't see any reasonable way that pg_dump can be expected to understand that a check constraint expresses a relationship between two tables. The semantics of check constraints aren't right for it anyway. All else being equal, I think the tables will be loaded in OID order, so a possible workaround is to create the plan table first. But an FK seems like a better answer. regards, tom lane
В списке pgsql-hackers по дате отправления: