RE: Hey! ORDER BY in VIEWS? - Mailing list pgsql-sql

From Robby Slaughter
Subject RE: Hey! ORDER BY in VIEWS?
Date
Msg-id EPEHLKLEHAHLONFOKNHNAENBDCAA.webmaster@robbyslaughter.com
Whole thread Raw
In response to Re: Hey! ORDER BY in VIEWS?  ("Josh Berkus" <josh@agliodbs.com>)
List pgsql-sql
Josh:

You wondered:

>What happens if I put an ORDER BY in a view, then call an ORDER BY in a
>query, e.g.:
>
>CREATE VIEW test_view AS
>SELECT client_name, city, zip FROM clients
>WHERE zip IS NOT NULL
>ORDER BY zip;
>
>SELECT * FROM test_view ORDER BY city;
>
>Does the second ORDER BY override or suppliment the view ORDER BY, or is
>it ignored?

I think this question falls into the "Don't ask, don't tell"
category of computer related questions. I can't think of a reason
to design this way, the behavior isn't specified or sensible, so just
don't do it!

Sorry if I'm over-admonishing. Curiosity killed the cat.

-Robby



pgsql-sql by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: Hey! ORDER BY in VIEWS?
Next
From: Tom Lane
Date:
Subject: Re: Hey! ORDER BY in VIEWS?