Re: Referential Integrity thru Views

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Kapil Tilwani <karan_pg_2(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Referential Integrity thru Views
Date: 2001-08-04 15:14:48
Message-ID: Pine.BSF.4.21.0108040810050.22211-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Fri, 3 Aug 2001, Kapil Tilwani wrote:

> Right now, I am enforcing uniqueness in three different tables
> (Supplier, Customer, Ledger) thru the front-end by checking thru a
> Union Query. Is it possible to enforce such a uniquenessthru in the
> DB.

Do you mean you want uniqueness of ids across the three tables so that
Customer's id never duplicates a Supplier id for example? If you're
using serial integer ids now (or a sequence), I'd suggest setting them all
to use the same sequence generator, barring wraparound, that should
guarantee uniqueness.

> Irrespective of the above, is it possible to have a foreign
> key check in this (???)

It depends on what you mean. As another poster said, if you mean
between those three tables individually, yes. If you mean a foreign key
to a view itself, like a union view, no.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nils O. =?iso-8859-1?q?Sel=E5sdal?= 2001-08-04 15:16:08 Re: Index-speeds
Previous Message robewald 2001-08-04 12:41:47 Variable number of arguments