Re: BUG #18467: postgres_fdw (deparser) ignores LimitOption
Japin Li <japinli@hotmail.com>
From: Japin Li <japinli@hotmail.com>
To: Etsuro Fujita <etsuro.fujita@gmail.com>
Cc: onderkalaci@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2024-05-16T09:54:03Z
Lists: pgsql-bugs
Attachments
On Thu, 16 May 2024 at 17:11, Etsuro Fujita <etsuro.fujita@gmail.com> wrote:
> Hi Japin,
>
> On Thu, May 16, 2024 at 1:02 PM Japin Li <japinli@hotmail.com> wrote:
>> AppendLimitClause() does not check the limitOption, which may be
>> LIMIT_OPTION_WITH_TIES. It simply uses the LIMIT clause.
>>
>> Here is a poc patch to verify the above.
>
> Thanks for the patch! Will review.
>
I find that the FETCH FIRST ... ROWS WITH TIES does not support type casting.
For example:
postgres=# SELECT * FROM pg_class ORDER BY relname FETCH FIRST 2::bigint ROWS WITH TIES;
ERROR: syntax error at or near "::"
LINE 1: ...ECT * FROM pg_class ORDER BY relname FETCH FIRST 2::bigint R...
^
I've made a change to support type casting in the select_fetch_first_value.
Please consider reviewing the v2 patch.
--
Regards,
Japin Li
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