Skip site navigation (1) Skip section navigation (2)

Batch Table Creation - Foreign Key Problem

From: Daniel Whelan <merlin(at)ophelan(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Batch Table Creation - Foreign Key Problem
Date: 2002-12-16 21:24:13
Message-ID: 3DFE447D.4080906@ophelan.com (view raw or flat)
Thread:
Lists: pgsql-novice
I'm trying to create a set of tables, some of which have a foreign key 
pointing to other tables in the same set. The problem arises when it 
tries to add a table before the table it depends on has been created. Is 
there any way to defer the checking of foreign key dependancies until 
after the whole transaction block?

Alternately, would I be better off creating the tables with no foreign 
keys, and issuing alter statements at the end to add the keys? Thanks!

Daniel


Responses

pgsql-novice by date

Next:From: Josh BerkusDate: 2002-12-16 21:28:37
Subject: Re: Redhat Database ???
Previous:From: Tom LaneDate: 2002-12-16 21:19:22
Subject: Re: Problems with pg_dump

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group