Re: Default order on displaying data without order clause

Поиск
Список
Период
Сортировка
От Wim Bertels
Тема Re: Default order on displaying data without order clause
Дата
Msg-id 1552652134.5846.11.camel@ucll.be
обсуждение исходный текст
Ответ на Default order on displaying data without order clause  (Janus <janus.e@gmail.com>)
Ответы Re: Default order on displaying data without order clause  (Dave Caughey <caugheyd@gmail.com>)
Список pgadmin-support
Janus schreef op vr 15-03-2019 om 12:20 [+0100]:
> In pgAdmin 3, an implicit default order by primary key is used when
> displaying data without an otherwise stated order. This is not the
> case in pgAdmin 4. The order seems somewhat arbitrary and the
> following statement from this site is definitely not true: "When you
> query data from a table, PostgreSQL returns the rows in the order
> that they were inserted into the table."

Hallo Janus,

this standard behaviour, as described by the ISO standard
:: ie unless you specify an ORDER BY clause, the order can be anything,
 like a (unordered) set;

the example of "the way there were inserted", this might often be the
case, but it's not a rule
more background: see planner, shared mem and cache

> 
> I do understand that some order of course exists, but from a
> human perspective it would make sense that default ordering is by PK,
> unless stated otherwise. In PgAdmin 4, is it possible to set a
> default ordering, at least so that displaying a table's contents
> using the "View Data" button, i.e. the query being run is altered
> from "SELECT oid, * FROM public.mytable" to "SELECT oid, * FROM
> public.mytable ORDER BY <primary key(s)>"?

i only see the filter/sort option

> 
> Thanks!
-- 
mvg,
Wim Bertels
--
Lector
UC Leuven-Limburg
--
Let me take you a button-hole lower.
        -- William Shakespeare, "Love's Labour's Lost"


В списке pgadmin-support по дате отправления:

Предыдущее
От: Janus
Дата:
Сообщение: Default order on displaying data without order clause
Следующее
От: Dave Caughey
Дата:
Сообщение: Re: Default order on displaying data without order clause