Re: [HACKERS] Syntax error and reserved keywords

2012-03-16 Thread Tom Lane
Heikki Linnakangas writes: > Accepting the keyword in such a context seems much harder to me than > providing a hint. To accept the keyword, you'd need a lot of changes to > the grammar, but for the hint, you just need some extra code in > yyerror(). Mind you, if it's a hint, it doesn't need to

Re: [HACKERS] Syntax error and reserved keywords

2012-03-16 Thread Heikki Linnakangas
On 16.03.2012 14:50, Dimitri Fontaine wrote: Peter Eisentraut writes: Is there a reason for us not to add an HINT: "user" is a reserved keyword or something like that, other than nobody having been interested in doing the work? If that were easily possible, we could just recognize 'user' as a

Re: [HACKERS] Syntax error and reserved keywords

2012-03-16 Thread Dimitri Fontaine
Peter Eisentraut writes: >> Is there a reason for us not to add an HINT: "user" is a reserved >> keyword or something like that, other than nobody having been interested >> in doing the work? > > If that were easily possible, we could just recognize 'user' as an > identifier in this context and av

Re: [HACKERS] Syntax error and reserved keywords

2012-03-14 Thread Peter Eisentraut
On ons, 2012-03-14 at 14:58 +0100, Dimitri Fontaine wrote: > A colleague came to me to express his surprise about this quite simple > use case: > > =# alter table toto add column user text; > ERROR: syntax error at or near "user" > LINE 1: alter table toto add column user text; > > Is ther

Re: [HACKERS] Syntax error and reserved keywords

2012-03-14 Thread Pavel Stehule
2012/3/14 Pavel Stehule : > 2012/3/14 Dimitri Fontaine : >> Hi, >> >> A colleague came to me to express his surprise about this quite simple >> use case: >> >>  =# alter table toto add column user text; >>  ERROR:  syntax error at or near "user" >>  LINE 1: alter table toto add column user text; >>

Re: [HACKERS] Syntax error and reserved keywords

2012-03-14 Thread Euler Taveira
On 14-03-2012 10:58, Dimitri Fontaine wrote: > Is there a reason for us not to add an HINT: "user" is a reserved > keyword or something like that, other than nobody having been interested > in doing the work? > AFAIK, there is no such warning message in the code. If you're volunteering to do it, p

Re: [HACKERS] Syntax error and reserved keywords

2012-03-14 Thread Pavel Stehule
2012/3/14 Dimitri Fontaine : > Hi, > > A colleague came to me to express his surprise about this quite simple > use case: > >  =# alter table toto add column user text; >  ERROR:  syntax error at or near "user" >  LINE 1: alter table toto add column user text; > > Is there a reason for us not to ad

[HACKERS] Syntax error and reserved keywords

2012-03-14 Thread Dimitri Fontaine
Hi, A colleague came to me to express his surprise about this quite simple use case: =# alter table toto add column user text; ERROR: syntax error at or near "user" LINE 1: alter table toto add column user text; Is there a reason for us not to add an HINT: "user" is a reserved keyword or