To expand on my earlier response, I can force this exact error if I use psql 9.1 to connect to a 9.5 server. During upgrades it is recommended to always update your clients, not only psql but any software that uses the client libs, first and then upgrade the server.
Cheers,
Steve