From: Ming <ming@cleanstormwater.com.au>
To: David Rowley <dgrowleyml@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: Postgres offset and limit bug
Date: Thu, 8 Sep 2022 08:48:58 +0000
Message-ID: <SYZP282MB3110CF86BB76ABA3983CC38FE5409@SYZP282MB3110.AUSP282.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <CAApHDvqUW8homCjinMhr6OyoX=6MYy1MDj_Mzq440+19gOxa-Q@mail.gmail.com>
References: <Mailbird-7af33f94-f8ca-401e-be1e-086ac6504238@cleanstormwater.com.au>
<CAApHDvqUW8homCjinMhr6OyoX=6MYy1MDj_Mzq440+19gOxa-Q@mail.gmail.com>
Hello David,
The issue is when I have limit 1 with the offset, the first record id will be 45 (which should be 46) . (Although, it’s ordered by path, the of is actually ordered as well.) But without the limit 1 the results will be correct. And when I plus one to the offset value, the actual offset will increase by 2.
In general, the offset value with 45 is behave as offset 44. But when change the value to other thing, the results will be all good.
Regards,
Ming
Get Outlook for iOS<https://aka.ms/o0ukef;
________________________________
From: David Rowley <dgrowleyml@gmail.com>
Sent: Thursday, September 8, 2022 6:36:04 PM
To: Ming <ming@cleanstormwater.com.au>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: Postgres offset and limit bug
On Thu, 8 Sept 2022 at 19:20, Ming <ming@cleanstormwater.com.au> wrote:
> We recently found a strange behavior on Postgres SQL. The offset function will not acting properly when having limit in the query. I want to confirm that it's an existing bug or it's my syntax is wrong.
Nothing looks wrong from here. Can you describe what behaviour you're expecting?
David
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: ming@cleanstormwater.com.au, dgrowleyml@gmail.com
Subject: Re: Postgres offset and limit bug
In-Reply-To: <SYZP282MB3110CF86BB76ABA3983CC38FE5409@SYZP282MB3110.AUSP282.PROD.OUTLOOK.COM>
References: <Mailbird-7af33f94-f8ca-401e-be1e-086ac6504238@cleanstormwater.com.au> <CAApHDvqUW8homCjinMhr6OyoX=6MYy1MDj_Mzq440+19gOxa-Q@mail.gmail.com> <SYZP282MB3110CF86BB76ABA3983CC38FE5409@SYZP282MB3110.AUSP282.PROD.OUTLOOK.COM>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox