Re: Order in CREATE VIEW

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
Cc: "Marcin Wasilewski" <marcingrupy(at)poczta(dot)onet(dot)pl>, pgsql-general(at)postgresql(dot)org
Subject: Re: Order in CREATE VIEW
Date: 2001-04-14 08:08:14
Message-ID: 13487.987235694@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Oliver Elphick" <olly(at)lfix(dot)co(dot)uk> writes:
> A view creates a virtual table; there is no implicit ordering in a table,
> so it follows that you should not be able to impose one in a view.

This is indeed the pure-SQL attitude, but it may be worth pointing out
that Postgres 7.1 does allow ORDER BY in subselects and views anyway.

The main reason that that seems like a good idea (IMHO at least) is that
ORDER BY together with LIMIT allow you to select specific rows in ways
that are difficult to accomplish otherwise.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Elphick 2001-04-14 08:40:32 Re: Order in CREATE VIEW
Previous Message Tom Lane 2001-04-14 07:59:31 Re: Backend sent D message without prior T