tchivs commented on code in PR #4075:
URL: https://github.com/apache/flink-cdc/pull/4075#discussion_r2256000416
##########
flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-postgres/src/main/java/org/apache/flink/cdc/connectors/postgres/factory/PostgresDataSourceFactory.java:
##########
@@ -369,23 +369,21 @@ private Optional<String> getValidateDatabaseName(String
tables) {
String.format(
"Tables format must db.schema.table, can not
'tables' = %s",
TABLES.key()));
- if (tableNameParts.length == 3) {
- String currentDbName = tableNameParts[0];
+ String currentDbName = tableNameParts[0];
+ checkState(
+ isValidPostgresDbName(currentDbName),
+ String.format(
+ "The value of option %s does not conform to
PostgresSQL database name naming conventions",
+ TABLES.key()));
+ if (dbName == null) {
+ dbName = currentDbName;
+ } else {
checkState(
- isValidPostgresDbName(currentDbName),
+ dbName.equals(currentDbName),
Review Comment:
I use the following configuration:
```
tables:
aia_test.public.aia_t_icc_jjdb,aia_test.public.aia_t_icc_jjdb_\d{6},aia_test.public.aia_t_icc_jjdb_extend,aia_test.public.aia_t_icc_jjdb_extend_\d{6},aia_test.public.aia_t_vcs_fkdb,aia_test.public.aia_t_vcs_fkdb_\d{6}
```
Tip java.lang.IllegalStateException: The value of option tables all table
names must have the same database name
Yes, I'm going to write a unit test, so I'll have to wait a moment.
--
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]