Skip to content

Commit 238f478

Browse files
committed
fix(task): Enhance error message for PG replication to include table_ddl options for replica identity
1 parent eee2923 commit 238f478

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

core/sling/task.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,13 @@ func ErrorHelper(err error) (helpString string) {
611611
case contains("CSV table encountered too many errors"):
612612
helpString = "Perhaps trying to load with `target_options.format=parquet` could help? This will use Parquet files instead of CSV files."
613613
case contains("it does not have a replica identity and publishes updates"):
614-
helpString = "Since PG replication is turned on, you'll need to create a replica identity on the respective table for executing UPDATE/DELETE operations. You can use hooks (such as pre_merge) to work around this with the following query => alter table {object.temp_full_name} replica identity full"
614+
helpString = `Since PG replication is turned on, you'll need to create a replica identity on the respective table for executing UPDATE/DELETE operations. You can use target_options.table_ddl to specify an extra statement to define the replication identity upon creation, such as:
615+
616+
target_options:
617+
table_ddl: |
618+
create table {object.full_name} ({col_types});
619+
alter table {object.full_name} replica identity full
620+
`
615621
}
616622
}
617623
return

0 commit comments

Comments
 (0)