Andres Freund <and...@anarazel.de> writes: > On 2018-10-12 19:47:40 -0400, Tom Lane wrote: >> So I went looking for a different example to plug in there, and soon >> found that there weren't any. If you change all the physically_coercible >> calls in that script to binary_coercible, its output doesn't change. >> I'm thinking that we ought to do that, and just get rid of >> physically_coercible(), so that we have a tighter, more semantically >> meaningful set of checks here. We can always undo that if we ever >> have occasion to type-cheat like that again, but offhand I'm not sure >> why we would do so.
> Hm, I wonder if it's not a good idea to leave the test there, or rewrite > it slightly, so we have a a more precise warning about cheats like that? After thinking about this for awhile, I decided that physically_coercible() is poorly named, because it suggests that it might for instance allow any 4-byte type to be cast to any other one. Actually the additional cases it allows are just ones where an explicit binary-coercion cast would be needed. So I still think we should tighten up the tests while we can, but I left that function in place with a different name and a better comment. regards, tom lane