* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> one). ISTM it'd be a good idea if it did, as "are there any incoming
> foreign keys" seems to be a question we constantly ask when solving
> update-performance problems, and there isn't any easy way to check for
> such. I'm not real sure what the printout should look like, though.
Agreed. Suggestion:
networx=> \d wdm_networx.loc_base_clinTable "wdm_networx.loc_base_clin" Column | Type | Modifiers
-------------+---------+-----------btable_id | integer | not nullloc_base_id | integer | not nullclin |
integer| not null
Indexes: "loc_base_clin_pkey" PRIMARY KEY, btree (btable_id, loc_base_id, clin) "btable_id_clin_unique" UNIQUE,
btree(btable_id, clin)
Foreign-key constraints: "loc_base_clin_btable_id_fkey" FOREIGN KEY (btable_id) REFERENCES
wdm_networx.btables_ref(btable_id) "loc_base_clin_clin_fkey" FOREIGN KEY (clin) REFERENCES wdm_networx.clin(clin)
"loc_base_clin_loc_base_id_fkey"FOREIGN KEY (loc_base_id) REFERENCES wdm_networx.loc_base_dscr(loc_base_id)
networx=> \d wdm_networx.loc_base_dscr Table "wdm_networx.loc_base_dscr" Column | Type
|Modifiers
----------------+------------------------+-----------loc_base_id | integer | not nulldescription |
charactervarying(254) | not nulllocations | character varying(254) | univ_mandatory | character varying(254) |
ent_mandatory | character varying(254) |
Indexes: "loc_base_dscr_pkey" PRIMARY KEY, btree (loc_base_id)
Referenced by: "loc_base_clin_loc_base_id_fkey" FOREIGN KEY (loc_base_id) BY wdm_networx.loc_base_clin(loc_base_id)
/|\ /|\ Referenced column(s) in *this* table
<----| |---> column(s) in referencing table
Just my 2c.
Thanks!
Stephen