Ok vedi a fare le cose alle 3 del mattino non si capisce nulla...

allora per ora quello che posso dire è:

usando information_schema.constraint_column_usage e information_schema.key_column_usage si può fare una bella join e sapere come il campo x della tabella y venga referenziato nel database.. purtroppo mi sa che l'unica sarà fare una query per ogni campo, ma almeno si può rendere la cosa parametrica

cmq chi avesse altre idee faccia pure uno squillo



EDIT:

se qualcuno volesse vedere una query:

Codice PHP:
SELECT
-- source informations
ccu
.table_name as source_tableccu.column_name as source_column,ccu.table_schema as source_schema,
--
dest informations
kcu
.table_name as dest_tablekcu.column_name as dest_columnkcu.table_schema as dest_schema,
--
constraint information
 ccu
.constraint_nameccu.constraint_schematc.constraint_type 
FROM
information_schema
.constraint_column_usage as ccu 
    inner join information_schema
.key_column_usage as kcu on 
        ccu
.constraint_name kcu.constraint_name and ccu.constraint_schema kcu.constraint_schema 
            inner join information_schema
.table_constraints as tc on 
                tc
.constraint_schema ccu.constraint_schema and tc.constraint_name ccu.constraint_name
ORDER BY lower
(ccu.table_nameasc