1

When provisioning our database in development, we are feeding in very long SQL statements to declare numerous functions. Sometimes, we make a mistake and there is a syntax error, so we get output like this:

PG::SyntaxError: ERROR:  syntax error at or near "BEGIN"
LINE 14782: BEGIN
            ^

That's fine, and we can eventually find the problem, but it would be really helpful if Postgres would emit a couple of lines before and after the problem instead of just the line with the problem. Is it possible to configure Postgres to print more lines before and after a PG::SyntaxError?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.