Remove PG's definition of `type_cast`

All cases except for `nil` in an array have been removed. `nil` in an
array is handled by the Array type object.
Merge pull request #16071 from sgrif/sg-pg-type-cast

Remove PG's definition of `type_cast`