'return a list of many2one relation with the given table.
:param table : the name of the sql table to return relations
:returns a list of tuple \'table name\', \'column name\'.'

def _get_fk_on(self, table):

    query = "\n                                                SELECT    cl1.relname    as    table,    att1.attname    as    column\n                                                FROM    pg_constraint    as    con,    pg_class    as    cl1,    pg_class    as    cl2,    pg_attribute    as    att1,    pg_attribute    as    att2\n                                                WHERE    con.conrelid    =    cl1.oid\n                                                                AND    con.confrelid    =    cl2.oid\n                                                                AND    array_lower(con.conkey,    1)    =    1\n                                                                AND    con.conkey[1]    =    att1.attnum\n                                                                AND    att1.attrelid    =    cl1.oid\n                                                                AND    cl2.relname    =    %s\n                                                                AND    att2.attname    =    'id'\n                                                                AND    array_lower(con.confkey,    1)    =    1\n                                                                AND    con.confkey[1]    =    att2.attnum\n                                                                AND    att2.attrelid    =    cl2.oid\n                                                                AND    con.contype    =    'f'\n                                "
    self._cr.execute(query, (table,))
    return self._cr.fetchall()
