This version removes the assumption that associations are made using an integer type. It now does not take much into consideration the type, leaving PG to figure the type out or raise errors.