Here's a v2 patch:
* Rebased over today's nearby commits
* Documentation changes added
* Sort abbrev support improved per Andrew's suggestions
* Infinities now considered to fail any typmod precision limit,
per discussion with Robert.
regards, tom lane