Cast individual fields of a row type
If an operation on a field of a row type requires an explicit cast,
you can explicitly cast the individual field value without consideration
of the row type with which the field is associated. The following
statement uses an explicit cast on the field value to handle the conversion:
SELECT col1 from tab1, tab2 WHERE col1.b = col2.b::FLOAT::d_float
If an operation on a field of a row type requires an implicit cast,
you can specify the correct field value and the database server handles
the conversion automatically. In the following statement, which compares
field values of different data types, a built-in cast automatically
converts between INT and FLOAT values:
SELECT col1 from tab1, tab2 WHERE col1.a = col2.b