rows are rendered not in serial order as appeared in database
As @a_horse_with_no_name already said: the data may not be stored in the sequential order.

You have some choices: 


Use a ORDER BY id[1] clause and force the database to sort the data for you.
Force a CLUSTER[2] on the table to rewrite the data and sort based on a index as you want. I don't recommend that as a solution for your question but it is a alternative. IMPORTANT: CLUSTER command only will physically sort the data on the disk, rewriting the data files based on the index. There is no guarantee of the data will be returned on the same order.


Hope it helps.

References:


https://www.postgresql.org/docs/current/static/queries-order.html
https://www.postgresql.org/docs/current/static/sql-cluster.html