Re: ORDER BY col is NULL in UNION causes error?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Mike Benoit <ipso(at)snappymail(dot)ca>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Glaesemann <grzm(at)seespotcode(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: ORDER BY col is NULL in UNION causes error?
Date: 2007-01-11 19:20:25
Message-ID: 200701111920.l0BJKP106601@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Mike Benoit wrote:
> That helps some, but I'm sure it could be even more clear.
>
> The main issue is that you can't order by an expression computed by
> unions, correct? So couldn't the error message by something like:
>
> "ORDER BY on a UNION/INTERSECT/EXCEPT result must match existing result
> columns and not be an expression")));

Well, it can be an expression _if_ the expression _matches_ an existing
UNION column.

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2007-01-11 19:21:15 Re: Trying to load MySQL data
Previous Message Merlin Moncure 2007-01-11 19:20:08 pg_standby testing notes