Despite RDS Postgres db instances always having a default postgres database if no db name is specified, secrets created from such db instances do not contain the dbname json property.
To Reproduce
Create an RDS Postgres instance without providing a dbname
Create a Secrets Manager secret to access this database.
Connect to the database using AWSSecretsManagerPostgreSQLDriver. Use the driver's connect method and pass the secret ARN for the URL.
Expected behavior
I think the proper behavior should be to append the forward slash always and then append the db name if it exists.
Describe the bug
According to the postgres driver, jdbc urls need to end with a forward slash: https://github.com/pgjdbc/pgjdbc/blob/5c9928d81e4a337518c1e1104ea17f4b29269320/pgjdbc/src/main/java/org/postgresql/Driver.java#L567
However, AWSSecretsManagerPostgreSQLDriver only appends the forward slash if a dbname is found in the secret: https://github.com/aws/aws-secretsmanager-jdbc/blame/42dc301cc7e1a47b148f8526392be9fe8ecdaff2/src/main/java/com/amazonaws/secretsmanager/sql/AWSSecretsManagerPostgreSQLDriver.java#L119
Despite RDS Postgres db instances always having a default postgres database if no db name is specified, secrets created from such db instances do not contain the dbname json property.
To Reproduce
connect
method and pass the secret ARN for the URL.Expected behavior I think the proper behavior should be to append the forward slash always and then append the db name if it exists.