NookVoive commented on issue #7386: URL: https://github.com/apache/seatunnel/issues/7386#issuecomment-2285852263
根据我自己排查的原因,以及基于其他人协助下,初步定位到问题原因在于: 1. 在生成建表语句前,会先进行判断 database 是否存在,而判断时会把查询到的 database 列表过滤掉系统 database 如:postgres,pg_catalog 等。这就导致会认为,数据库:postgres 不存在,进而认为需要先创建 database。 2. 在实际执行创建数据库的语句时,则因为系统数据库已存在,则会触发 sql 执行报错。也就是报错内容:database "postgres" already exists。 3. 那么这就导致一个实际上结果:无法在同步数据到系统数据库下时,自动建表。 截图如下: 判断数据库是否存在: <img width="997" alt="image" src="https://github.com/user-attachments/assets/7f8cad7d-d097-4a1e-bc31-744ca9290542"> 排除系统数据库: <img width="791" alt="image" src="https://github.com/user-attachments/assets/7d931f3c-4959-41d7-bbbe-c39deca9f24a"> 系统数据库列表: <img width="904" alt="image" src="https://github.com/user-attachments/assets/c58f592c-28aa-4940-a4b6-24eee93b4496"> -- 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]
