Re: Allow an alias for the target table in UPDATE/DELETE

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: Allow an alias for the target table in UPDATE/DELETE
Дата
Msg-id 1137910919.8798.25.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Re: Allow an alias for the target table in UPDATE/DELETE  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Allow an alias for the target table in UPDATE/DELETE
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Allow an alias for the target table in UPDATE/DELETE
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Allow an alias for the target table in UPDATE/DELETE