| From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | Dave Page <dpage(at)vale-housing(dot)co(dot)uk>, "'Fernando Nasser'" <fnasser(at)cygnus(dot)com>, Neil Padgett <npadgett(at)redhat(dot)com>, pgsql-patches(at)postgresql(dot)org |
| Subject: | Re: Patch for Improved Syntax Error Reporting |
| Date: | 2001-09-06 16:30:48 |
| Message-ID: | 200109061630.f86GUmN00871@candle.pha.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-patches |
Email added to TODO.detail.
> Dave Page <dpage(at)vale-housing(dot)co(dot)uk> writes:
> > Oh, I quite agree. I'm not adverse to updating my code, I just want to avoid
> > users getting misleading messages until I come up with those updates.
>
> Hmm ... if they were actively misleading then I'd share your concern.
>
> I guess what you're thinking is that the error offset reported by the
> backend won't correspond directly to what the user typed, and if the
> user tries to use the offset to manually count off characters, he may
> arrive at the wrong place? Good point. I'm not sure whether a message
> like
>
> ERROR: parser: parse error at or near 'frum';
> POSITION: 42
>
> would be likely to encourage people to try that. Thoughts? (I do think
> this is a good argument for not embedding the position straight into the
> main error message though...)
>
> One possible compromise is to combine the straight character-offset
> approach with a simplistic context display:
>
> ERROR: parser: parse error at or near 'frum';
> POSITION: 42 ... oid,relname FRUM ...
>
> The idea is to define the "POSITION" field as an integer offset possibly
> followed by whitespace and noise words. An updated client would grab
> the offset, ignore the rest of the field, and do the right thing. A
> not-updated client would display the entire message, and with any luck
> the user would read it correctly.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Rene Pijlman | 2001-09-06 17:04:59 | Re: JDBC patch procedures (Re: [PATCHES] Patch for jdbc2 ResultSet.java) |
| Previous Message | Bruce Momjian | 2001-09-06 16:14:26 | Re: ODBC Patch to deal with poor boolean handling. |