SEZ9 commented on issue #12601:
URL: https://github.com/apache/seatunnel/issues/12601#issuecomment-5965271053

   Following up on the root cause: in the Postgres-CDC → JDBC Postgres 
schema-evolution path, `PostgresDialect.buildAddColumnSQL` copies the 
`sourceType` it receives (Debezium's unquoted, unqualified `pg_type.typname`) 
verbatim into the generated ADD COLUMN DDL. That is why a user-defined type 
with a mixed-case name, a reserved-word name, or a type in a schema outside the 
sink's `search_path` fails to resolve on the sink side.
   
   There is a related PR intended to be the single implementation path for 
this, so please don't open a duplicate. Where it stands relative to this report:
   
   - Its quoting helper can preserve an already-qualified type spelling, which 
covers the quoting half of the problem.
   - It does not yet cover the CDC half: Debezium's `Column.typeName()` hands 
us the bare type name without its namespace, so quoting alone cannot recover a 
type outside `search_path`.
   
   Before this issue can be closed, the PR needs:
   
   1. An end-to-end CDC-to-PostgreSQL schema-change test (type pre-created in 
the sink) covering a mixed-case type name, a reserved-word type name, and a 
type in a schema outside `search_path`.
   2. A decision on the approach: either carry authoritative namespace/quoting 
metadata for the source type through to the sink DDL, or fail with a clear 
unsupported-type diagnostic. Silently emitting an unqualified name is not 
acceptable.
   
   If you can share the exact type-creation and ADD COLUMN statements from your 
environment plus the resulting sink-side error, that would help confirm the 
test cases match what you hit. Leaving this open until the PR covers the above.
   
   <!-- streview-comment:1488 -->


-- 
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]

Reply via email to