Explicit casts on fields of an unnamed row type

When a conversion between two row types involves an explicit cast to convert between particular field values, you can explicitly cast the row type value but are not required to explicitly cast the individual field.

The following statement shows how to insert a value into the tab1 table:
INSERT INTO tab1 VALUES (ROW( 3, 5.66::FLOAT::d_float))
To insert a value from col1 of tab1 into col2 of tab2, you must explicitly cast the row value because the database server does not automatically handle conversions between the d_float distinct type of tab1 to the FLOAT type of table tab2:
INSERT INTO tab2 SELECT col1::ROW(a INT, b FLOAT) FROM tab1

In this example, the cast that is used to convert the b field is explicit because the conversion from d_float to FLOAT requires an explicit cast (to convert a distinct type to its source type requires an explicit cast).

In general, to cast between two unnamed row types where one or more of the fields uses an explicit cast, you must explicitly cast at the level of the row type, not at the level of the field.