Re: [HACKERS] Do we support using agg or window functions in delete statement?

Поиск
Список
Период
Сортировка
От 高增琦
Тема Re: [HACKERS] Do we support using agg or window functions in delete statement?
Дата
Msg-id CAFmBtr31Tfz1EqkgiUUBtV416Ak+2gkjR6=ifJ0okFG_nxgCiA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Do we support using agg or window functions in delete statement?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Thanks a lot for reply.

2017-01-11 20:46 GMT+08:00 Tom Lane <tgl@sss.pgh.pa.us>:
高增琦 <pgf00a@gmail.com> writes:
> In transformDeleteStmt:

>     qry->hasWindowFuncs = pstate->p_hasWindowFuncs;
>     qry->hasAggs = pstate->p_hasAggs;
>     if (pstate->p_hasAggs)
>         parseCheckAggregates(pstate, qry);

> Do we support using agg or window function in delete statement?
> Or, this code should be removed?

I think it's dead code given the syntactic limitations on DELETE,
but I would not be in favor of removing it.  Better to have it there to
keep transformDeleteStmt looking as much as possible like the other ones.
It's not like that's either expensive or a lot of code.

At present, only transformSelectStmt and transformSetOperationStmt
has parseCheckAggregates. All other transformXXXStmt don't contain it.

This inconsistency makes me have the question at the first mail.
I think it maybe better to do something.

 

An example of why this would be penny-wise and pound-foolish is that
we might choose to apply the check that you can't write aggregates in
DELETE inside parseCheckAggregates.  (We don't, but it's not an impossible
future restructuring.)

                        regards, tom lane



--

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: [HACKERS] parallelize queries containing subplans
Следующее
От: Etsuro Fujita
Дата:
Сообщение: [HACKERS] Misplacement of function declaration incontrib/postgres_fdw/postgres_fdw.h