PostgreSQL 错误 [42804]: ERROR: UNION types text and timestamp without time zone cannot be matched
产生原因: 使用 UNION 联合多段 sql 语句时,每段 sql 中的相同字段类型不一致
如图,字段 zzsj 在 table_a 中类型为 timestamp ,在 table_b 中类型为字符串,此时进行 union 操作, 就会报错: 文本和时间戳无法匹配
解决方式: union 时将相同字段转化成相同类型, 上述报错是出现在PostgreSQL 中,故使用pg语法将字符串类型转化为 timestamp 类型
至此,问题解决,运行成功.