pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Ross J. Reedstrom <reedstrm@rice.edu>
Cc: Roland Roberts <roland@astrofoto.org>
Cc: Yudie <yudie@axiontech.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: How to select and result row number??
Date: Tue, 17 Sep 2002 18:43:44 -0400
Message-ID: <12283.1032302624@sss.pgh.pa.us> (raw)
In-Reply-To: <200209172221.g8HMLH227467@candle.pha.pa.us>
References: <200209172221.g8HMLH227467@candle.pha.pa.us>

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



view thread (9+ messages)

Message-ID: <12283.1032302624@sss.pgh.pa.us>
Permalink:  ../12283.1032302624@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/12283.1032302624@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgman@candle.pha.pa.us, reedstrm@rice.edu, roland@astrofoto.org, yudie@axiontech.com
  Subject: Re: How to select and result row number??
  In-Reply-To: <12283.1032302624@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox