Re: help with bison - Mailing list pgsql-hackers

From Bear Giles
Subject Re: help with bison
Date
Msg-id 200204110352.VAA16612@eris.coyotesong.com
Whole thread Raw
In response to Re: help with bison  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: help with bison  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> > As an aside, is there any reason to treat TEMP and TEMPORARY as two
> > separate identifiers?
> 
> Yes: if the lexer folds them together then unreserved_keyword can't
> regenerate the equivalent name properly.

But if they're synonyms, is that necessary?  I'm not indifferent to the
benefits of being able to recreate an input string exactly when all other
things are equal, but things aren't equal here.  TEMPORARY is a SQL92
keyword, TEMP is described as a "Keyword for Postgres support," but the
grammar shows that one never appears without the other.

So why not deprecate TEMP and always show TEMPORARY when reconstructing
the query?

> You might be right that the grammar could benefit from some refactoring,
> though I'm not at all sure if that really helps from an
> execution-efficiency (number of states) standpoint.

The goal of the refactoring wouldn't be execution efficiency, it would 
be simplifying maintenance of the grammar.  And it looks like it's the
common practice elsewhere, just not in the OptTemp and OptTempTableName
rules.

Bear


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: help with bison
Next
From: Hiroshi Inoue
Date:
Subject: Re: RFC: Restructuring pg_aggregate