Skip to main content

Better Vertica syntax error return messages please!

  • June 12, 2019
  • 9 replies
  • 12 views

ehaavindberman

Is it possible to return a line number in syntax error messages? Something like:
Syntax error near "("
is completely unhelpful when I have 40+ open parentheses in a query.

I know you can get the cursor position of the error, so why not be able to count the new lines between the start of the doc and the cursor position?

9 replies

Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • June 12, 2019

Does your query have line terminators? Ha. Those are elimiated by the parse (like ALL DBs).


ehaavindberman
  • Author
  • New Participant
  • June 12, 2019

Hey Jim, in fact I also use MySQL where line numbers ARE returned in syntax error messages.


Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • June 12, 2019

MySQL was developed by developers. Vertica is built to analyze data, not your SQL.


ehaavindberman
  • Author
  • New Participant
  • June 12, 2019

okay....but you need to write SQL to access the data and for debugging that SQL code it's pretty nice as a user to have helpful error messages


Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • June 12, 2019

What client are you using?


ehaavindberman
  • Author
  • New Participant
  • June 12, 2019

SQLWorkbenchJ if that's what you mean? I don't get anything different using DbVisualizer either.


Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • June 12, 2019

I can ask engineering about this. But u know Vertica is a fast analytic DB. You can't bloat the engine (i.e. Oracle)

Maybe the better solution is to run your SQL through a simple online checker?


ehaavindberman
  • Author
  • New Participant
  • June 12, 2019

Thanks Jim, I hear you


gyoung
  • New Participant
  • June 18, 2019

vsql does give line numbers for syntax errors. E.g.

ERROR 4856: Syntax error at or near "AS" at character 440
LINE 11: END, 0) AS ctr,
76: ^

Maybe you can use vsql for debugging a query.