Foreign Key relationship between two databases

Started by Sandeep Gaikwadabout 21 years ago3 messagesgeneral
Jump to latest
#1Sandeep Gaikwad
sgaikwad@vertex.co.in

Hi,
I am using postgres 7.3.4. I am new to postgres.
I can give foreign key relationship between two tables of same database. Can I give foreign key relationship between tables of two databases ? Plz, let me know if possible & send me how can I do that?

Thanks & Regards,
Sandeep.

#2Stephan Szabo
sszabo@megazone23.bigpanda.com
In reply to: Sandeep Gaikwad (#1)
Re: [SQL] Foreign Key relationship between two databases

On Thu, 27 Jan 2005, Sandeep Gaikwad wrote:

I can give foreign key relationship between two tables of same
database. Can I give foreign key relationship between tables of two
databases ? Plz, let me know if possible & send me how can I do that?

Unfortunately, that's not really currently possible. You might be able to
fake some portion of it with custom triggers using dblink but I don't
think the locking would entirely work.

#3Dawid Kuroczko
qnex42@gmail.com
In reply to: Sandeep Gaikwad (#1)
Re: Foreign Key relationship between two databases

On Thu, 27 Jan 2005 18:47:44 +0530, Sandeep Gaikwad
<sgaikwad@vertex.co.in> wrote:

Hi,
I am using postgres 7.3.4. I am new to postgres.
I can give foreign key relationship between two tables of same database. Can I give foreign key relationship between tables of two databases ? Plz, let me know if possible & send me how can I do that?

Well... what you can do is replicate such table between two pg databases
using Slony-I and then use foreign key on this replicated table.

Regards,
Dawid