Improve error message and hint for ALTER COLUMN TYPE can't-cast failure.
authorTom Lane <[email protected]>
Fri, 12 Jun 2015 15:54:03 +0000 (11:54 -0400)
committerTom Lane <[email protected]>
Fri, 12 Jun 2015 15:54:03 +0000 (11:54 -0400)
commitae6ae424b502afcc514a2ce14de476a9714b6a75
tree36754bc528576035559ead8c45b2be305f73e4f1
parent582eff507eb3e3acae8c7d2d562ac2beb00b344f
Improve error message and hint for ALTER COLUMN TYPE can't-cast failure.

We already tried to improve this once, but the "improved" text was rather
off-target if you had provided a USING clause.  Also, it seems helpful
to provide the exact text of a suggested USING clause, so users can just
copy-and-paste it when needed.  Per complaint from Keith Rarick and a
suggestion from Merlin Moncure.

Back-patch to 9.2 where the current wording was adopted.
src/backend/commands/tablecmds.c
src/test/regress/expected/alter_table.out
src/test/regress/sql/alter_table.sql