Re: Updatable views/with check option parsing - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Updatable views/with check option parsing
Date
Msg-id 447713F5.9010409@dunslane.net
Whole thread Raw
In response to Re: Updatable views/with check option parsing  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Updatable views/with check option parsing
List pgsql-hackers
Peter Eisentraut wrote:
> Am Mittwoch, 24. Mai 2006 20:42 schrieb Tom Lane:
>   
>> Peter Eisentraut <peter_e@gmx.net> writes:
>>     
>>> I have spent some time figuring out how to resolve the parsing conflicts
>>> in Bernd Helmle's updatable views patch.  The problem has now been
>>> reduced to specifically this situation:
>>>       
>> Could we see the proposed patches for gram.y?
>>     
>
> Here it is.
>
> $ make -W gram.y gram.c
> bison -y -d  gram.y
> conflicts: 4 shift/reduce
>
> These are basically for instances of the same problem.
>   

I had a quick look - I don't think there is an easy answer with the 
current proposed grammar. If we want to prevent shift/reduce conflicts I 
suspect we'd need to use a different keyword than WITH, although I can't 
think of one that couldn't be a trailing clause on a select statment, 
which is the cause of the trouble. Another possibility would be to move 
the optional WITH clause so that it would come before the AS clause. 
Then there should be no conflict, I believe. Something like:
ViewStmt: CREATE OptTemp VIEW qualified_name opt_column_list              opt_check_option AS SelectStmt

cheers

andrew





pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Bug with UTF-8 character
Next
From: Tom Lane
Date:
Subject: Re: Updatable views/with check option parsing