SQLGlot: how to raise on unsupported write features?
03:05 01 Nov 2025

If I do

>>> sqlglot.transpile('select mean(a), b from df group by all', read='duckdb', write='postgres', error_level=sqlglot.errors.ErrorLevel.WARN)
['SELECT MEAN(a), b FROM df GROUP BY ALL']

then I get no error or warning, even though group by all isn't valid in postgres SQL

How can I transpile from DuckDB SQL to Postgres SQL (or any other dialect), in such a way that it will raise or warn if it encounters something not valid in the target dialect?

sql sqlglot