Kevin Grittner <[email protected]> writes:
> On Fri, Sep 2, 2016 at 9:25 AM, Tom Lane <[email protected]> wrote:
>> ORDER BY is not a useful suggestion when there is nothing
>> you could order by to get the old behavior.
> I'm apparently missing something, because I see a column with the
> header "generate_series" in the result set.
You are apparently only thinking about generate_series and not any
other SRF. Other SRFs don't necessarily produce outputs that are
in a nice sortable order. Even for one that does, sorting by it
would destroy the existing behavior:
regression=# select *, generate_series(1,3) from int8_tbl;
q1 | q2 | generate_series
------------------+-------------------+-----------------
123 | 456 | 1
123 | 456 | 2
123 | 456 | 3
123 | 4567890123456789 | 1
123 | 4567890123456789 | 2
123 | 4567890123456789 | 3
4567890123456789 | 123 | 1
4567890123456789 | 123 | 2
4567890123456789 | 123 | 3
4567890123456789 | 4567890123456789 | 1
4567890123456789 | 4567890123456789 | 2
4567890123456789 | 4567890123456789 | 3
4567890123456789 | -4567890123456789 | 1
4567890123456789 | -4567890123456789 | 2
4567890123456789 | -4567890123456789 | 3
(15 rows)
Now you could argue that the ordering of the table rows
themselves is poorly defined, and you'd be right, but that
doesn't change the fact that the generate_series output
has a well-defined repeating sequence. People might be
relying on that property.
regards, tom lane
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers