I have a table in my database where I store dates using the following standard:
YYYY-MM-DD. As you can see, I'm not saving the hour. The first time I exported the same table to a csv file I got the following records in this order:
AAA@outlook.com BBB@gmail.com CCC@gmail.com DDD@hotmail.com
But when I ran the same query to export the data to the same CSV, I received the records in this following order:
AAA@outlook.com firstname.lastname@example.org email@example.com firstname.lastname@example.org
So, the conclusion that I reached is when sorting data as this can be non deterministic. Isn't? This is my query to export the data from my database:
SELECT id AS "_id", cpf, email, name, agency, account, "createdDate" FROM "NextUsers", "Users" WHERE "userId"="Users".id ORDER BY "createdDate" OFFSET $1 LIMIT 500;
Where $1 starts at 0 and it is incremented with 500 per iteration. OBS: The returned data from both queries are correctly sorted but not following in the same order as you can see.