Re: Foreign Keys Question

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Matthias Loitsch <m(at)tthias(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Foreign Keys Question
Date: 2005-04-13 16:00:02
Message-ID: 20050413160002.GA21890@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Apr 13, 2005 at 13:54:05 +0200,
Matthias Loitsch <m(at)tthias(dot)com> wrote:
>
> So I thought I could make a foreign key on a different Schema (db), and
> use the same table....
>
> And well, thats where I started to search if this is possible ... and,
> in fact my main question is: Is this a good idea?
> I have no idea if this will be fast enough, or if I will have lots of
> problems afterward....
>
> Could anyone help me with this ?

Schemas are just a name space, so using foreign keys accross schemas
shouldn't be a problem.

However, it you later put the contents of the schema on other server
or even in another database, then you are going to need to make a copy
of the data as you can't make foreign key references outside of
the current database.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2005-04-13 16:37:51 Re: psql vs perl prepared inserts
Previous Message Tom Lane 2005-04-13 15:50:41 Re: Composite type versus Domain constraints.