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

From: Neil Conway <neilc(at)samurai(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Atsushi Ogawa <atsushi(dot)ogawa(at)gmail(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Allow an alias for the target table in UPDATE/DELETE
Date: 2006-01-22 06:21:59
Message-ID: 1137910919.8798.25.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-01-22 06:28:31 Re: Allow an alias for the target table in UPDATE/DELETE
Previous Message Tom Lane 2006-01-22 05:55:18 Re: Allow an alias for the target table in UPDATE/DELETE