Amazon documentation recommends this -
----
Set the JDBC connection parameter "preferQueryMode" to "extendedForPrepared" to avoid pinning. The "extendedForPrepared" ensures that the extended mode is used only for prepared statements.
The default for the preferQueryMode parameter is "extended", which uses the extended mode for all queries. The extended mode uses a series of Prepare, Bind, Execute, and Sync requests and corresponding responses. This type of series causes connection pinning in an RDS proxy.
----
----
jdbc:postgresql://myapplication-2020123456789.somedomain.region.rds.amazonaws.com:5432/dbname?ApplicationName=myAppName&preferQueryMode=extendedForPrepared
----