I am trying to use flink1.18 sql-client.sh to read pg data, but failed with uppercase field, named idLog
.
I found that flink automatically converts uppercase fields to lowercase fields.
I try to work with ORACLE, Flink work success with uppercase field.
CREATE TABLE tmp_tb (
`aa` string,
`idLog` string
) WITH (
'connector' = 'jdbc',
'url' = 'jdbc:postgresql://vm131:5432/postgres',
'username' = 'postgres',
'password' = '123456',
'table-name' = 'public.roamer'
);
Flink SQL> select `idLog` from tmp_tb;
error log
[ERROR] Could not execute SQL statement. Reason:
org.postgresql.util.PSQLException: ERROR: column "idlog" does not exist
Hint: Perhaps you meant to reference the column "roamer.idLog".
Position: 8
Only double quoted identifiers are case sensitive in postgres.
From the docs:
Unfortunately, it looks like you hit a bug because you cannot use double quotes in FlinkSQL so this has to be fixed in the JDBC connector, see: FLINK-23324.