Re: BUG #18467: postgres_fdw (deparser) ignores LimitOption
Önder Kalacı <onderkalaci@gmail.com>
From: Önder Kalacı <onderkalaci@gmail.com>
To: Japin Li <japinli@hotmail.com>
Cc: Etsuro Fujita <etsuro.fujita@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Alvaro Herrera <alvherre@alvh.no-ip.org>, pgsql-bugs@lists.postgresql.org
Date: 2024-05-30T07:15:10Z
Lists: pgsql-bugs
Hi, 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: /* > * Also, the LIMIT/OFFSET cannot be pushed down, if their expressions are > * not safe to remote. > */ > if (!is_foreign_expr(root, input_rel, (Expr *) parse->limitOffset) || > !is_foreign_expr(root, input_rel, (Expr *) parse->limitCount)) > return; Hence, I thought it is OK to add this new check to this place. 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? Thanks, Onder
Commits
-
postgres_fdw: Refuse to send FETCH FIRST WITH TIES to remote servers.
- 2b461efc5195 13.16 landed
- 269e2c391628 14.13 landed
- b33c141cc52b 15.8 landed
- 8405d5a37a25 16.4 landed
- 8cfbac1492bd 17.0 landed
-
Revert temporal primary keys and foreign keys
- 8aee330af55d 17.0 cited