We often run all queries prefixed with EXPLAIN QUERY PLAN to detect syntax errors. Two warnings: make sure your query consist of a single statement. Otherwise your the second one will actually be executed, e.g. EXPLAIN QUERY PLAN SELECT 1; DROP TABLE employees If your script uses CREATE statements, which will only be executed with EXPLAIN QUERY PLAN CREATE ..., later queries that refer to these objects will of course fail because the objects do not exist. Similar for ALTER TABLE.