Re: How to select and result row number?? - Mailing list pgsql-sql

From Tom Lane
Subject Re: How to select and result row number??
Date
Msg-id 12283.1032302624@sss.pgh.pa.us
Whole thread Raw
In response to Re: How to select and result row number??  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-sql
Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> Say what?  Given the ORDER BY in the subselect, it will.

> When you specify a table in FROM, there is no ordering to the table.  Is
> it guaranteed that a subquery in FROM _does_ have an ordering.

If you write ORDER BY, we'll implement it.

> Does ANSI say it has an ordering?

ANSI forbids ORDER BY in sub-selects, so they don't have to address the
question.

> What if the subquery is involved in a join?

We are entitled to reorder its output for purposes of processing the
join, then.  But that's entirely irrelevant to the example as given.
There is no reason to reorder the subselect output, and we won't.
        regards, tom lane


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: cannot delete bug
Next
From: Richard Huxton
Date:
Subject: Re: Returning a reference to a cursor from a function