automatic detection of nomore references rows - Mailing list pgsql-novice

From Nabil Sayegh
Subject automatic detection of nomore references rows
Date
Msg-id 1054041350.6563.34.camel@billy
Whole thread Raw
List pgsql-novice
Hi all,

here's my question of the day:

Since 7.3 now has some more intelligent FOREIGN KEYs (i.e. pg_dump still
knows that certain triggers serve as foreign keys)
is it possible to detect unreferenced rows ?

e.g.:

upload
--------------------
id_upload | filename

picture
--------------------
id_upload | orientation

attachement
--------------------
id_upload | name

Of course I could detect unreferenced rows myself with NOT EXISTS etc.
but as I have many tables that reference upload it would be more
convenient to

SELECT id_upload FROM upload WHERE id_upload IS UNREFERENCED

or something like that.

bye
--
 e-Trolley Sayegh & John, Nabil Sayegh
 Tel.: 0700 etrolley /// 0700 38765539
 Fax.: +49 69 8299381-8
 PGP : www.e-trolley.de


pgsql-novice by date:

Previous
From: Nabil Sayegh
Date:
Subject: Re: Inserting data of two other tables [Now deleting ...]
Next
From: hodges@xprt.net
Date:
Subject: Re: Examples of accessing postgresql with scripts?