Re: Foreign keys - Mailing list pgsql-general

From weigelt@metux.de
Subject Re: Foreign keys
Date
Msg-id 20030628220213.GB9442@metux.de
Whole thread Raw
In response to Re: Foreign keys  (Richard Huxton <dev@archonet.com>)
List pgsql-general
On Thu, Jun 26, 2003 at 02:12:22PM +0100, Richard Huxton wrote:

<snip>

> It looks like he has a centralised "address" table with "customer_addresses"
> linking "customer" to "address". Likewise for "supplier".
>
> His problem was he wanted to remove address details when nothing referred to
> them any more.

I'd run an garbage collection over the db from time to time.
It should be an easy test to select (or delete) all address rows which
ID doesnt exist anywhere else.

You can easily put this in an function.

cu

--
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux ITS
 Webhosting ab 5 EUR/Monat.          UUCP, rawIP und vieles mehr.

 phone:     +49 36207 519931         www:       http://www.metux.de/
 fax:       +49 36207 519932         email:     contact@metux.de
 cellphone: +49 174 7066481         smsgate:   sms.weigelt@metux.de
---------------------------------------------------------------------
 Diese Mail wurde mit UUCP versandt.      http://www.metux.de/uucp/

pgsql-general by date:

Previous
From: weigelt@metux.de
Date:
Subject: Re: How many fields in a table are too many
Next
From: Markus Bertheau
Date:
Subject: Re: Redhat's "enhancements" to PG