Re: BUG #18467: postgres_fdw (deparser) ignores LimitOption

From: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
To: Önder Kalacı <onderkalaci(at)gmail(dot)com>
Cc: Japin Li <japinli(at)hotmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18467: postgres_fdw (deparser) ignores LimitOption
Date: 2024-05-30 13:08:30
Message-ID: CAPmGK141d866G7OSHkAS7u3yQicc2oW51WO4VmbJdeq6f0gA9g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Onder,

On Thu, May 30, 2024 at 4:15 PM Önder Kalacı <onderkalaci(at)gmail(dot)com> wrote:

>> and 2) ORDER BY must already
>> > have been determined to be safe to push down before we get here.

> When I read the code, the decision for that seems to happen in the next line where this patch proposes to modify:

That is not correct; see my previous email.

>> So
>> > in that case, if getting here, we can consider that WITH TIES is also
>> > safe to push down (if the remote is v13 or later).

> See Tom's response here on why it might not be a good idea to pushdown
> WITH TIES: https://www.postgresql.org/message-id/2114796.1715878709%40sss.pgh.pa.us
>
> I think, at least not with this patch, this patch is like a bug-fix. If intended, it should be possible to
> pushdown WITH TIES with a follow-up patch?

With all due respect to him, I think he is missing that the set of
ties is determined according to ORDER BY; as explained in that email,
in that case it is guaranteed that ORDER BY is pushable, so WITH TIES
is also pushable with ORDER BY, I think. We do not currently have a
way to do a remote-version check (without accessing the remote
server), so I agree with you that we should just diable pushing WITH
TIES fow now, though.

Thanks!

Best regards,
Etsuro Fujita

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2024-05-30 15:37:13 Re: BUG #18484: "Cannot enlarge string buffer" during parallel execution of prepared statement/partitioning
Previous Message Etsuro Fujita 2024-05-30 12:56:19 Re: BUG #18467: postgres_fdw (deparser) ignores LimitOption