Thanks for the patch, and welcome to Postgres development.
I can confirm that it works fine. I have attached here a very slightly tweaked version of the patch (removed trailing whitespace, and changed some comment text).
I'm marking this ready for committer.
Thanks for the review. Hope i will be able to contribute a little here and there in the future.