Tuples are not inserted sequentially in database table?

后端 未结 3 885
甜味超标
甜味超标 2020-12-12 06:29

I am trying to insert 10 values of the format \"typename_\" + i where i is the counter of the loop in a table named roomtype with attributes typename

3条回答
  •  悲&欢浪女
    2020-12-12 07:10

    You are not seeing the order in which PostgreSQL stores the data, but rather the order in which pgadmin displays it.

    The edit table feature of pgadmin automatically sorts the data by the primary key by default. that is what you are seeing.

    In general, databases store table data in whatever order is convenient. Since you did not intentionally supply an ORDER BY you have no right to care what order it is actually in.

提交回复
热议问题