Error message mnemonic needs to be displayed in error to tie with documentation in errors.rst
Currently, an error only displays the error text and not the error message mnemonic. For example, below is the output for an `AGGREGATE_FUNCTION_NESTED` error. **Query output** ```sql OCTO> SELECT 1+2*AVG(AVG(id)) FROM names; [ERROR] src/qualify_statement.c:183 2020-09-08 16:42:41 : Aggregate function calls cannot be nested Error with syntax near (line 1, column 15): SELECT 1+2*AVG(AVG(id)) FROM names; ^^^^^^^ ``` The coresponding documentation refers to the error message mnemonic as can be seen below. **doc/errors.rst** ```rst ++++++++++++++++++++++++++++ AGGREGATE_FUNCTION_NESTED ++++++++++++++++++++++++++++ This error is generated when aggregate function calls are nested, which is not allowed. PSQL Error Code: 42803 ``` But given an `[ERROR]` message output of `Aggregate function calls cannot be nested`, I have no easy way of tying it to the `AGGREGATE_FUNCTION_NESTED` error documentation in `doc/errors.rst`. 1) One way of fixing this would be for the error message output to contain `AGGREGATE_FUNCTION_NESTED` too. For example, something like the following. ```sql [ERROR] src/qualify_statement.c:183 2020-09-08 16:42:41 : AGGREGATE_FUNCTION_NESTED: Aggregate function calls cannot be nested ``` 2) An alternative approach would be to include the error message text in the documentation. For example, have the following in `doc/errors.rst`. ```rst +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ AGGREGATE_FUNCTION_NESTED : Aggregate function calls cannot be nested +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ This error is generated when aggregate function calls are nested, which is not allowed. PSQL Error Code: 42803 ``` 3) Another alternative would be to implement (1) and (2). (3) seems the most user-friendly but I am fine even if just (1) is implemented.
issue