This is because the redshift driver is registered as being able to handle both the jdbc:postgresql URL prefix and the jdbc:redshift URL prefix.
When the Postgres and Redshift drivers boot from their cans, each of them registers with DriverManger.
The logic implemented in DriverMananger.getDriver() and DriverManager.getConnection() is a loop through each of the drivers and stops as soon as the driver indicates that it is able to process this URL.
If the Postgres driver is registered first, everything works fine, because the Postgres driver is trying to process jdbc:postgresql . If the Redshift driver manages to register first, then the Postgres driver will never be used.
The only way I decided to solve is to add:
static {
source share