Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns multiplesh - Mailing list pgsql-sql

From Tom Lane
Subject Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns multiplesh
Date
Msg-id 29204.951840577@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns multiplesh  (Don Baccus <dhogaza@pacifier.com>)
Responses Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns multiplesh  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-sql
Don Baccus <dhogaza@pacifier.com> writes:
> I vote for the SQL92 TEMPORARY.  Let's not add a keyword that is non-standard
> just because one or another commercial database makes use of it,

You're missing the point: we are not talking about *adding* a keyword,
we're talking about *removing* one that we've already supported for
a year or so.  That changes matters considerably, IMHO.

I have in fact been able to make a conflict-free grammar in which TEMP
is accepted but not reserved.  It requires a certain amount of
redundancy in the productions (see below), but I think this is a
worthwhile tradeoff for not breaking existing user code.

Shall I commit this?
        regards, tom lane


/** Redundancy here is needed to avoid shift/reduce conflicts,* since TEMP is not a reserved word.  See also OptTemp.**
Theresult is a cons cell (not a true list!) containing* a boolean and a table name.*/
 
OptTempTableName:  TEMPORARY opt_table relation_name               { $$ = lcons(makeInteger(TRUE), (List *) $3); }
    | TEMP opt_table relation_name               { $$ = lcons(makeInteger(TRUE), (List *) $3); }           | LOCAL
TEMPORARYopt_table relation_name               { $$ = lcons(makeInteger(TRUE), (List *) $4); }           | LOCAL TEMP
opt_tablerelation_name               { $$ = lcons(makeInteger(TRUE), (List *) $4); }           | GLOBAL TEMPORARY
opt_tablerelation_name               {                   elog(ERROR, "GLOBAL TEMPORARY TABLE is not currently
supported");                  $$ = lcons(makeInteger(TRUE), (List *) $4);               }           | GLOBAL TEMP
opt_tablerelation_name               {                   elog(ERROR, "GLOBAL TEMPORARY TABLE is not currently
supported");                  $$ = lcons(makeInteger(TRUE), (List *) $4);               }           | TABLE
relation_name              { $$ = lcons(makeInteger(FALSE), (List *) $2); }           | relation_name               {
$$= lcons(makeInteger(FALSE), (List *) $1); }       ;
 


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns multiplesh
Next
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns multiplesh