Improve error reporting for broken SQL statement
Hello, I have two SQL statements causing issues in the plan stage. The first, I resolved
Error: failed to apply desired state: failed to apply schema SQL to temporary schema pgschema_tmp_20260406_120557_bd36cbfc: ERROR: zero-length delimited identifier at or near """" (SQLSTATE 42601)
Which turned out I needed to change
SET search_path = ""
to
SET search_path = ''
Once I resolved that, I now have this:
Error: failed to apply desired state: failed to apply schema SQL to temporary schema pgschema_tmp_20260406_120648_5bfb9e73: ERROR: syntax error at or near "SELECT" (SQLSTATE 42601)
but it's too generic for me to figure out where it's happening. I enabled verbose logging but it dumps a huge concat of all schemas, making it hard to locate.
Please provide the schema
Hi @tianzhou , the schema is quite huge - i've attached the output file from plan - the rest is sort of project specific though and spread across a few hundred files.
Thanks. The fix is on main. We will publish a new release in a week or two
Thank you!!