Re: Bug in error reporting for multi-line JSON

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Hamid Akhtar <hamid.akhtar@gmail.com>, Simon Riggs <simon.riggs@enterprisedb.com>, pgsql-bugs@postgresql.org
Date: 2021-03-01T21:50:01Z
Lists: pgsql-bugs, pgsql-hackers
Daniel Gustafsson <daniel@yesql.se> writes:
> I'm changing the status of this patch to Ready for Committer.

I reviewed this and pushed it, with some changes.

I noted that there was a basically unused "line_start" field in
JsonLexContext, which seems clearly to have been meant to track
what the new field was going to track.  So we can fix this without
any new field by updating that at the right times.

I thought putting jsonb tests into json.sql was a bit poorly
thought out.  I ended up adding parallel tests to both json.sql
and jsonb.sql ... maybe that's overkill, but a lot of the rest
of those scripts is duplicative too.  The tests weren't exercising
the dots-at-start-of-line behavior, either.

			regards, tom lane



Commits

  1. Remove redundant test.

  2. Improve reporting for syntax errors in multi-line JSON data.