Re: Second RewriteQuery complains about first RewriteQuery in edge case

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: Second RewriteQuery complains about first RewriteQuery in edge case
Дата
Msg-id CAEZATCWfNB6PjQgm_1U-PymE8FAZvSKbC2LntHa3YbYohMtffg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Second RewriteQuery complains about first RewriteQuery in edge case  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Thu, 27 Nov 2025 at 21:40, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Yeah, this looks pretty good.  Two nitpicky suggestions:
>
> * Perhaps using foreach_current_index() would be better than
> adding the separate loop variable "i" in RewriteQuery.

Ah, good point. I'd forgotten about that macro.

> * I think it would be wise to add a comment about this in
> rewriteRuleAction too, perhaps along the lines of
>
> -       /* OK, it's safe to combine the CTE lists */
> +       /*
> +        * OK, it's safe to combine the CTE lists.  Beware that RewriteQuery
> +        * knows we concatenate the lists in this order.
> +        */
>         sub_action->cteList = list_concat(sub_action->cteList,
>                                           copyObject(parsetree->cteList));

Agreed. Done that way.

Thanks for reviewing.

Regards,
Dean



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