yuqi1129 opened a new issue, #12938:
URL: https://github.com/apache/gravitino/issues/12938
### Version
main branch
### Describe what's wrong
A PostgreSQL catalog can be created without `jdbc-database`, even though
schema/table operations require it. The catalog is accepted and only fails on
first use, including when the database is already specified in `jdbc-url`.
### Error message and/or stacktrace
```text
IllegalArgumentException: null in jdbc-database is invalid. The value can't
be blank
at JdbcConfig.getJdbcDatabase
at PostgreSqlSchemaOperations.initialize
at JdbcCatalogOperations.initialize
```
### How to reproduce
1. Create a `jdbc-postgresql` catalog with a working PostgreSQL connection
and these properties, omitting `jdbc-database`:
```json
{
"jdbc-url": "jdbc:postgresql://localhost:5432/demo",
"jdbc-driver": "org.postgresql.Driver",
"jdbc-user": "postgres",
"jdbc-password": "<password>"
}
```
2. List schemas in the catalog. Initialization fails because `jdbc-database`
is missing, although `demo` is already present in the URL.
### Additional context
Resolve the database from the JDBC URL when the separate property is
omitted. Reject missing/blank database names during catalog configuration, and
reject conflicting names when both the URL and `jdbc-database` specify a
database. Keep other JDBC providers' existing requirements unchanged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]