Found while transpiling PostgreSQL -> Microsoft Fabric (T-SQL) with polyglot-sql 0.5.15 (main 43a4458, latest release tag). Scope: SELECT queries only. Every "Actual" value was captured directly from transpile(sql, DialectType::PostgreSQL, DialectType::Fabric). Unless the table notes otherwise, each case also reproduces under Dialect::get(PostgreSQL).transpile_with(sql, Fabric, TranspileOptions::strict()). Cross-checked against the existing PostgreSQL->Fabric issue series (#257-#286) to avoid duplicates.
Failing SELECT query
| Input (PostgreSQL) |
Actual (invalid) |
Expected (approx.) |
SELECT format('%s-%s', a, b) FROM t |
SELECT FORMAT('%s-%s', a, b) FROM t |
SELECT CONCAT(a, '-', b) FROM t |
Defect: PG format(fmt, args…) is printf-style; T-SQL FORMAT(value, format[, culture])
takes a value first. FORMAT('%s-%s', a, b) is nonsensical (3 args, string first) and doesn't
interpolate.
Root cause: the same TO_CHAR/DATE_FORMAT→FORMAT renaming path (tsql.rs:1725+) collides
with PG's unrelated format().
Fix: translate format() with %s/%I/%L specifiers into CONCAT/quoting; do not route it
through T-SQL FORMAT.
Failing SELECT query
SELECT format('%s-%s', a, b) FROM tSELECT FORMAT('%s-%s', a, b) FROM tSELECT CONCAT(a, '-', b) FROM tDefect: PG
format(fmt, args…)isprintf-style; T-SQLFORMAT(value, format[, culture])takes a value first.
FORMAT('%s-%s', a, b)is nonsensical (3 args, string first) and doesn'tinterpolate.
Root cause: the same
TO_CHAR/DATE_FORMAT→FORMATrenaming path (tsql.rs:1725+) collideswith PG's unrelated
format().Fix: translate
format()with%s/%I/%Lspecifiers intoCONCAT/quoting; do not route itthrough T-SQL
FORMAT.