Tom> Not to mention that the whole idea of that being a semantically
Tom> significant property of a name is a monstrous kluge.
You are right here.
Just in case, Marko Kreen says (see [1]) pgbouncer has all the information
required to remap statement names, so he says pgbouncer needs no
cooperation from backend nor from app side in order to implement
prepared statements properly.
[1]: https://github.com/pgbouncer/pgbouncer/issues/126#issuecomment-200900171
Vladimir