forked from apache/flink-cdc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cdc-connector][postgres] Apply DBZ-5398 postgres connector to handle…
… functional unique index (apache#2842) This closes apache#2710.
- Loading branch information
1 parent
ff002b5
commit 052e7b8
Showing
6 changed files
with
135 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...source-connectors/flink-connector-postgres-cdc/src/test/resources/ddl/index_type_test.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
-- Copyright 2023 Ververica Inc. | ||
-- | ||
-- Licensed under the Apache License, Version 2.0 (the "License"); | ||
-- you may not use this file except in compliance with the License. | ||
-- You may obtain a copy of the License at | ||
-- http://www.apache.org/licenses/LICENSE-2.0 | ||
-- Unless required by applicable law or agreed to in writing, | ||
-- software distributed under the License is distributed on an | ||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
-- KIND, either express or implied. See the License for the | ||
-- specific language governing permissions and limitations | ||
-- under the License. | ||
|
||
-- ---------------------------------------------------------------------------------------------------------------- | ||
-- DATABASE: key_type_test | ||
-- ---------------------------------------------------------------------------------------------------------------- | ||
-- Generate a number of tables to cover as many of the PG index situation (primary key, unique index) as possible | ||
DROP SCHEMA IF EXISTS indexes CASCADE; | ||
CREATE SCHEMA indexes; | ||
SET search_path TO indexes; | ||
|
||
-- Generate a table without primary key but a functional unique index | ||
CREATE TABLE functional_unique_index | ||
( | ||
id INTEGER NOT NULL, | ||
char_c CHAR | ||
); | ||
create unique index test_tbl_idx | ||
on functional_unique_index(id, COALESCE(char_c, ''::text)); | ||
|
||
ALTER TABLE functional_unique_index | ||
REPLICA IDENTITY FULL; | ||
|
||
INSERT INTO functional_unique_index | ||
VALUES (1, 'a'); |