Re: [GENERAL] Circular references

2013-06-21 Thread David Johnston
Melvin Call wrote > To summarize, the organization entity has an attribute of creator, which > is a foreign key to the user table, but the user has to belong to an > organization, which is a foreign key to the organization table. Since > neither are nullable, there is no way to create even an initi

Re: [GENERAL] Circular references

2013-06-21 Thread Melvin Call
Hi Ladislav and Alban, Thanks for the suggestions regarding the DEFERRED constraint. While certainly a viable option, I would expect the dump to maintain those constraints. The lack of them indicates to me that somehow an initial insert was created and then the structure was modified to support th

Re: [GENERAL] Circular references

2013-06-21 Thread Melvin Call
Hi Tom, First an apology of sorts. The restore doesn't fail, but the COPY statements generate errors about the referenced table not containing the key values (as you seem to have figured out that I meant). I have no idea what version of PostgreSQL the remote system is running, I just have the dump

Re: [GENERAL] Circular references

2013-06-21 Thread Ladislav Lenart
Hello. I think this CAN happen in practice when the constraints are DEFERRED, because as such are checked at COMMIT time. HTH, Ladislav Lenart On 21.6.2013 05:08, Tom Lane wrote: > Melvin Call writes: >> I was given a dump of an existing remote schema and database, and the >> restore on my lo

Re: [GENERAL] Circular references

2013-06-21 Thread Alban Hertroys
On 21 June 2013 05:08, Tom Lane wrote: > Melvin Call writes: > > I was given a dump of an existing remote schema and database, and the > > restore on my local system failed. Looking into it, I found a circular > > parent-child/child-parent relationship, and I don't believe this existing > > stru

Re: [GENERAL] Circular references

2013-06-20 Thread Tom Lane
Melvin Call writes: > I was given a dump of an existing remote schema and database, and the > restore on my local system failed. Looking into it, I found a circular > parent-child/child-parent relationship, and I don't believe this existing > structure is viable. To summarize, the organization ent

[GENERAL] Circular references

2013-06-20 Thread Melvin Call
I was given a dump of an existing remote schema and database, and the restore on my local system failed. Looking into it, I found a circular parent-child/child-parent relationship, and I don't believe this existing structure is viable. To summarize, the organization entity has an attribute of creat