Skip to content

Commit 7f24e19

Browse files
fix(postgres-cdc): fix validation of PK with uppercase (#16793) (#16798)
Co-authored-by: StrikeW <[email protected]>
1 parent 97a0861 commit 7f24e19

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

e2e_test/source/cdc/cdc.load.slt

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ create table shipments_2 (
161161
# Test user-provided publication
162162
statement ok
163163
create table t1_rw (
164-
v1 int primary key,
164+
"V1" int primary key,
165165
v3 varchar
166166
) with (
167167
connector = 'postgres-cdc',

e2e_test/source/cdc/postgres_cdc.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ INSERT INTO person VALUES (1001, 'peter white', '[email protected]', '1781 2313
3131
INSERT INTO person VALUES (1002, 'sarah spencer', '[email protected]', '3453 4987 9481 6270', 'los angeles');
3232

3333
create schema abs;
34-
create table abs.t1 (v1 int primary key, v2 double precision, v3 varchar, v4 numeric);
35-
create publication my_publicaton for table abs.t1 (v1, v3);
34+
create table abs.t1 ("V1" int primary key, v2 double precision, v3 varchar, v4 numeric);
35+
create publication my_publicaton for table abs.t1 ("V1", v3);
3636
insert into abs.t1 values (1, 1.1, 'aaa', '5431.1234');
3737

3838

java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/PostgresValidator.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,7 @@ private void validateTableSchema() throws SQLException {
180180
var pkFields = new HashSet<String>();
181181
while (res.next()) {
182182
var name = res.getString(1);
183-
// RisingWave always use lower case for column name
184-
pkFields.add(name.toLowerCase());
183+
pkFields.add(name);
185184
}
186185

187186
if (!ValidatorUtils.isPrimaryKeyMatch(tableSchema, pkFields)) {

0 commit comments

Comments
 (0)