Re: Updatable views/with check option parsing

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Updatable views/with check option parsing
Date: 2006-05-26 14:43:01
Message-ID: 447713F5.9010409@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut wrote:
> Am Mittwoch, 24. Mai 2006 20:42 schrieb Tom Lane:
>
>> Peter Eisentraut <peter_e(at)gmx(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-05-26 14:50:28 Re: Updatable views/with check option parsing
Previous Message Martijn van Oosterhout 2006-05-26 14:37:25 Re: Bug with UTF-8 character