I think this would be useful to create a tool/library which needs to handle frontend/backend protocol messages in detail.
Shouldn't that generally be done by extending libpq to add the required functionality?
If you're extending the server-side protocol and want to handle new message types, you're presumably able to extend libpq too. If you're not extending the server-side protocol, what is it that you want to do but cannot currently do with libpq? Is there a reaonable way to add that to libpq?