A
A
Anton89892022-03-19 14:43:43
PostgreSQL
Anton8989, 2022-03-19 14:43:43

Why does the position of rows in a table column change when data is updated?

Good afternoon) Can you please tell me why when changing the data in the table, the changed line is overwritten at the end of the table and how this can be avoided, maybe I made the request incorrectly?

await db.query(`UPDATE resume set value = $1, type = $2 where id = $3  RETURNING *`, [value, type, id ])


6235c15e44446160174940.png

If I now change the column with index 112, then it will stand at the end of the table, how can this be avoided, and so that changes just occur in the row, without overwriting it at the end
6235c1eab7407154368686.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2022-03-19
@Anton8989

in the sql standard there is no beginning and end, each subd does everything in its own way, the order is guaranteed only by explicitly specifying it, through order by

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question