C4W3 Assignment

When run very first pyspark script in pyspark notebook get error:
: org.postgresql.util.PSQLException: FATAL: database “:5432/postgres” does not exist
my script:
information_tables_df = spark.read.jdbc(jdbc_url, “information_schema.tables”, properties=jdbc_properties)
information_tables_df.select([“table_schema”, “table_name”]).show()
how i configured postgres:
RDS_ENDPOINT = “de-c4w3a1-rds.c9ocgmg8qz72.us-east-1.rds.amazonaws.com/
jdbc_url = f"jdbc:postgresql://{RDS_ENDPOINT}:5432/postgres" # For PostgreSQL

jdbc_properties = {
“user”: “postgresuser”,
“password”: “adminpwrd”,
“driver”: “org.postgresql.Driver” # For PostgreSQL
}

Hello @Tan_Quoc_Bao_Nguyen,

I could reproduce the issue with database ":5432/postgres" does not exist. It seems that the extra ‘/’ at the end of the RDS_Endpoint is causing it. Could you try without adding the ‘/’ at the end, thanks:

RDS_ENDPOINT = "de-c4w3a1-rds.cba2ousas82r.us-east-1.rds.amazonaws.com/" <--Remove '/' at the End
jdbc_url = f"jdbc:postgresql://{RDS_ENDPOINT}:5432/postgres"  # For PostgreSQL

Error I reproduced: