Re: pgsql: postgres_fdw: Fix assertion in estimate_path_cost_size().

From: Robins Tharakan <tharakan(at)gmail(dot)com>
To: Etsuro Fujita <efujita(at)postgresql(dot)org>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: postgres_fdw: Fix assertion in estimate_path_cost_size().
Date: 2022-12-12 12:28:55
Message-ID: CAEP4nAza+0fTCLkgkKYux3JDo3tUBTQORehP+aCxSNURpSFpHw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Hi,

I think this bugfix needs to be backpatched to v12 too.

See backtrace / repro SQL here -
https://www.postgresql.org/message-id/17713-92cce66de7e81c04%40postgresql.org

-
Robins Tharakan
Amazon Web Services

On Fri, 5 Feb 2021 at 17:05, Etsuro Fujita <efujita(at)postgresql(dot)org> wrote:
>
> postgres_fdw: Fix assertion in estimate_path_cost_size().
>
> Commit 08d2d58a2 added an assertion assuming that the retrieved_rows
> estimate for a foreign relation, which is re-used to cost pre-sorted
> foreign paths with local stats, is set to at least one row in
> estimate_path_cost_size(), which isn't correct because if the relation
> is a foreign table with tuples=0, the estimate would be set to 0 there
> when not using remote estimates.
>
> Per bug #16807 from Alexander Lakhin. Back-patch to v13 where the
> aforementioned commit went in.
>
> Author: Etsuro Fujita
> Reviewed-by: Kyotaro Horiguchi
> Discussion: https://postgr.es/m/16807-9fe4e08fbaa5c7ce%40postgresql.org
>
> Branch
> ------
> REL_13_STABLE
>
> Details
> -------
> https://git.postgresql.org/pg/commitdiff/984384129bb8a92481d4f7ddd5dede2d781b191f
>
> Modified Files
> --------------
> contrib/postgres_fdw/expected/postgres_fdw.out | 18 ++++++++++++++++++
> contrib/postgres_fdw/postgres_fdw.c | 2 +-
> contrib/postgres_fdw/sql/postgres_fdw.sql | 12 ++++++++++++
> 3 files changed, 31 insertions(+), 1 deletion(-)
>

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2022-12-12 14:11:25 pgsql: Get rid of recursion-marker values in enum AlterTableType
Previous Message Michael Paquier 2022-12-12 07:52:59 pgsql: Add support for GRANT SET in psql tab completion