"Steve Tucknott (TuSol)" <steve(at)tusol(dot)co(dot)uk> writes:
> I have a few tables that are subservient to multiple other tables
> (notes, addresses, attached documents etc).
> These tables carry the 'owning' table name and its record's PK.
> I can manually keep these tables tidy and avoid orphans, but is there a
> way within postgresql to reference these tables on a FK constraint to
> automatically delete the subservient recs when the parent is deleted?
Maybe I'm missing something, but aren't you just looking for the
ON DELETE CASCADE option of foreign key constraints?
regards, tom lane