Received: from sss.pgh.pa.us ([216.151.103.158]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3E88Q872614 for ; Sat, 14 Apr 2001 04:08:26 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f3E88ER13490; Sat, 14 Apr 2001 04:08:14 -0400 (EDT) To: "Oliver Elphick" cc: "Marcin Wasilewski" , pgsql-general@postgresql.org Subject: Re: Order in CREATE VIEW In-reply-to: <200104140623.f3E6NqU29861@linda.lfix.co.uk> References: <200104140623.f3E6NqU29861@linda.lfix.co.uk> Comments: In-reply-to "Oliver Elphick" message dated "Sat, 14 Apr 2001 07:23:51 +0100" Date: Sat, 14 Apr 2001 04:08:14 -0400 Message-ID: <13487.987235694@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200104/575 X-Sequence-Number: 7723 "Oliver Elphick" 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