Re: [HACKERS] Better handling of parse errors

Поиск
Список
Период
Сортировка
Искать

Re: [HACKERS] Better handling of parse errors

От:
Gavin Sherry <swm@linuxworld.com.au>
Дата:
Вложения:
On Wed, 14 Aug 2002, Tom Lane wrote:

> Gavin Sherry  writes:
> > ... do we want to modify every 7.2 error message?
> 
> Nyet ... but I don't think tacking an offset onto the end of
> "parse error at or near foo" messages is likely to cause the
> sort of generalized havoc you suggest ...

In that case, attached is a patch which locates the beginning of the
offending token more efficiently (per your suggestion of using
scanbuf). The new patch does the same as before:

template1=# select * frum pg_class;
ERROR:  parser: parse error at or near "frum" at character 10

It also implement's Tom's suggestion:

template1=# select * from pg_class where\g
ERROR:  parse: parse error at end of input

Gavin

Re: [HACKERS] Better handling of parse errors

От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:

Your patch has been added to the PostgreSQL unapplied patches list at:

	http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


Gavin Sherry wrote:
> On Wed, 14 Aug 2002, Tom Lane wrote:
> 
> > Gavin Sherry  writes:
> > > ... do we want to modify every 7.2 error message?
> > 
> > Nyet ... but I don't think tacking an offset onto the end of
> > "parse error at or near foo" messages is likely to cause the
> > sort of generalized havoc you suggest ...
> 
> In that case, attached is a patch which locates the beginning of the
> offending token more efficiently (per your suggestion of using
> scanbuf). The new patch does the same as before:
> 
> template1=# select * frum pg_class;
> ERROR:  parser: parse error at or near "frum" at character 10
> 
> It also implement's Tom's suggestion:
> 
> template1=# select * from pg_class where\g
> ERROR:  parse: parse error at end of input
> 
> Gavin

Content-Description: 

[ Attachment, skipping... ]

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: [HACKERS] Better handling of parse errors

От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:

Patch applied.  Thanks.

---------------------------------------------------------------------------


Gavin Sherry wrote:
> On Wed, 14 Aug 2002, Tom Lane wrote:
> 
> > Gavin Sherry  writes:
> > > ... do we want to modify every 7.2 error message?
> > 
> > Nyet ... but I don't think tacking an offset onto the end of
> > "parse error at or near foo" messages is likely to cause the
> > sort of generalized havoc you suggest ...
> 
> In that case, attached is a patch which locates the beginning of the
> offending token more efficiently (per your suggestion of using
> scanbuf). The new patch does the same as before:
> 
> template1=# select * frum pg_class;
> ERROR:  parser: parse error at or near "frum" at character 10
> 
> It also implement's Tom's suggestion:
> 
> template1=# select * from pg_class where\g
> ERROR:  parse: parse error at end of input
> 
> Gavin

Content-Description: 

[ Attachment, skipping... ]

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
FAQ