Re: Allow an alias for the target table in UPDATE/DELETE - Mailing list pgsql-patches

From Neil Conway
Subject Re: Allow an alias for the target table in UPDATE/DELETE
Date
Msg-id 1137910919.8798.25.camel@localhost.localdomain
Whole thread Raw
In response to Re: Allow an alias for the target table in UPDATE/DELETE  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Allow an alias for the target table in UPDATE/DELETE
List pgsql-patches
On Sun, 2006-01-22 at 00:55 -0500, Tom Lane wrote:
> This is wrong:
>
> +relation_expr_opt_alias: relation_expr
> +                {
> +                    $$ = $1;
> +                }
> +            | relation_expr opt_as IDENT
> +                {
> +
>
> Should be ColId, not IDENT, per existing alias_clause production.

That causes a reduce/reduce conflict:

state 557

  934 relation_expr_opt_alias: relation_expr .
  935                        | relation_expr . opt_as ColId

    AS  shift, and go to state 875

    $end      reduce using rule 934 (relation_expr_opt_alias)
    SET       reduce using rule 754 (opt_as)
    SET       [reduce using rule 934 (relation_expr_opt_alias)]
    USING     reduce using rule 934 (relation_expr_opt_alias)
    WHERE     reduce using rule 934 (relation_expr_opt_alias)
    ')'       reduce using rule 934 (relation_expr_opt_alias)
    ';'       reduce using rule 934 (relation_expr_opt_alias)
    $default  reduce using rule 754 (opt_as)

    opt_as  go to state 876

> Also, while I'm all for getting to 100 regression tests, this is a
> mighty lame 100th entry.

Why's that? We needed regression tests for the changes to DELETE (IMHO),
and I didn't see an existing test file where it would have made much
sense to add them. I don't think the barrier for adding a new regression
test should be particularly high, provided the test covers a clear set
of functionality (such as the "DELETE" statement).

-Neil



pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Allow an alias for the target table in UPDATE/DELETE
Next
From: Tom Lane
Date:
Subject: Re: Allow an alias for the target table in UPDATE/DELETE