Possibly because JDBC does everything using the V3 protocol whereas psql does not. psql uses simple query.
Maybe JDBC is doing something else? I cannot duplicate the error when doing it via the protocol (DBD::Pg) or via psql. Even forcing non-server-side prepares (i.e. making the driver replace the vars itself) fails to fail.
Чтобы сделать работу с сайтом удобнее, мы используем cookie и аналитический сервис «Яндекс.Метрика». Продолжая пользоваться сайтом, вы соглашаетесь с их использованием.