After applying patch, on error condition it displays error message two times as follows:
ERROR: column "abc" does not exist at character 23
STATEMENT: insert into ax
values(abc);
psql:a.sql:7: ERROR: column "abc" does not exist
LINE 2: values(abc);
user may confuse because of repeated error messages. so I think its better to display only one message, one of the possible ways is as follows:
ERROR: column "abc" does not exist at character 23
STATEMENT: insert into ax
values(abc);
Am I missing something ?
LINE info is a part of error message and should be eliminated by terse mode
[pavel@localhost ~]$ psql -v ECHO=error -f test.sql postgres > /dev/null psql:test.sql:4: ERROR: syntax error at or near ";" LINE 2: 10 + ; ^ psql:test.sql:4: STATEMENT: select 10 + ; psql:test.sql:8: ERROR: syntax error at end of input LINE 2: 30 + ^ psql:test.sql:8: STATEMENT: select 30 +
but you can switch to terse mode:
[pavel@localhost ~]$ psql -v ECHO=error -v VERBOSITY=terse -f test.sql postgres > /dev/null psql:test.sql:4: ERROR: syntax error at or near ";" at character 13 psql:test.sql:4: STATEMENT: select 10 + ; psql:test.sql:8: ERROR: syntax error at end of input at character 13 psql:test.sql:8: STATEMENT: select 30 +
What is what you would
I am sending updated patch - buggy statement is printed via more logical psql_error function instead printf