Re: Function call order dependency

From: "Stephen R(dot) van den Berg" <srb(at)cuci(dot)nl>
To: pgsql(at)mohawksoft(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Function call order dependency
Date: 2008-09-03 15:08:01
Message-ID: 20080903150801.GA9761@cuci.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

pgsql(at)mohawksoft(dot)com wrote:
>Would it be something like: "where" clause first, left to right, followed
>by select terms, left to right, and lastly the "order by" clause?

I don't know what ANSI says, nor do I know what PostgreSQL exactly does
at the moment, but, the only thing you can reasonably count on is that
the WHERE clause is evaluated before the SELECT-result-rows and the
ORDER BY clause (in any SQL database).

You cannot depend on any left to right order, and you cannot depend on
ORDER BY being evaluated after the SELECT-result-rows.
--
Sincerely,
Stephen R. van den Berg.

"<Clarions sounding> *No one* expects the Spanish inquisition!"

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2008-09-03 15:09:22 Re: [PATCH] Cleanup of GUC units code
Previous Message Tom Lane 2008-09-03 15:05:19 Re: Function call order dependency