I think I might have found a bug sorting by date but I could use some help 
confirming.
I have attached a csv file with an “id” and “start_date” field which you can 
load into a into a table like this:CREATE TABLE TEST (
    ID BIGSERIAL NOT NULL,
    START_DATE TIMESTAMP with time zone,
    CONSTRAINT PK_TEST PRIMARY KEY (ID)
);

If I run the following 2 queries, I often see the last row from the first query 
appear as the first row in the second query:
SELECT * FROM test ORDER BY start_date DESC LIMIT 50 OFFSET 100
SELECT * FROM test ORDER BY start_date DESC LIMIT 50 OFFSET 150

The behavior is inconsistent. Sometimes I see 217 at the end of the first query 
and 218 at the start of the second (good), sometimes I see 218 at the end of 
the first query and 217 at the start of the second (also valid), sometimes I 
see 217 at the end of the first query and 217 at the start of the second (bad), 
sometimes I see 218 at the end of the first query and 218 at the start of the 
second (bad).
I don’t see the same issue when I order by id.
Again, this behavior is spurious and you may need to run the same queries 
multiple times to see different results. 

Please let me know if anyone else can replicate.

Thanks in advance,
Peter


My environment:
Java 21.0.1
Windows 11
H2 2.2.224 (PostgreSQL mode)

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/203854027.7473057.1712942179783%40mail.yahoo.com.

Attachment: test.csv
Description: MS-Excel spreadsheet

Reply via email to