Re: version issue?

From: "Dan Wilson" <phpPgAdmin(at)acucore(dot)com>
To: "Alfred Perlstein" <bright(at)wintelcom(dot)net>
Cc: "pgsql general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: version issue?
Date: 2001-02-26 14:30:57
Message-ID: 003b01c0a000$bd172a30$078353d8@danwilson
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ok... here's what I tried. I was mistaken in my beta version.

sib=# select version();
version
------------------------------------------------------------------------
PostgreSQL 7.1beta3 on i686-pc-linux-gnu, compiled by GCC egcs-2.91.66
(1 row)

sib=# SELECT first_name, last_name, middle_name, u.uid, end_year FROM
user_info u, auth a WHERE u.uid = pri_key AND a.auth_table = 'user_info' AND
live = 't' AND mission_id IN ('36') AND u.end_year > date_part('year', date
'today') - 2 UNION SELECT first_name, last_name, middle_name, u.uid,
end_year FROM user_info u, current c WHERE u.uid = c.uid ORDER BY
UPPER(last_name);

ERROR: Attribute 'last_name' not found

sib=# SELECT first_name, last_name, middle_name, u.uid, end_year FROM
user_info u, auth a WHERE u.uid = pri_key AND a.auth_table = 'user_info' AND
live = 't' AND mission_id IN ('36') AND u.end_year > date_part('year', date
'today') - 2 UNION SELECT first_name, last_name, middle_name, u.uid,
end_year FROM user_info u, current c WHERE u.uid = c.uid ORDER BY
UPPER(u.last_name);

ERROR: Relation 'u' does not exist

sib=# SELECT first_name, last_name, middle_name, u.uid, end_year FROM
user_info u, auth a WHERE u.uid = pri_key AND a.auth_table = 'user_info' AND
live = 't' AND mission_id IN ('36') AND u.end_year > date_part('year', date
'today') - 2 UNION SELECT first_name, last_name, middle_name, u.uid,
end_year FROM user_info u, current c WHERE u.uid = c.uid ORDER BY
UPPER(user_info.last_name);

ERROR: ORDER BY on a UNION/INTERSECT/EXCEPT result must be on one of the
result columns

Is this a bug in beta3? One of those combinations should work!

-Dan

----- Original Message -----
From: "Alfred Perlstein" <bright(at)wintelcom(dot)net>

> * Dan Wilson <phpPgAdmin(at)acucore(dot)com> [010225 22:47] wrote:
> > I have the following query running on two different servers. It works
on
> > 7.0.3 and gives the following error on 7.1beta4.
> >
> > ERROR: Attribute 'last_name' not found
> >
> > Your SQL statement:
> > SELECT first_name, last_name, middle_name, u.uid, end_year
> > FROM user_info u, auth a
> > WHERE u.uid = pri_key AND a.auth_table = 'user_info' AND live = 't'
> > AND site_id IN ('214') AND u.end_year > date_part('year', date
'today') - 2
> > UNION
> > SELECT first_name, last_name, middle_name, u.uid, end_year
> > FROM user_info u, current c
> > WHERE u.uid = c.uid
> > ORDER BY UPPER(last_name)
> >
> > I'm figuring it is in the ORDER BY, but I'm not sure. Can anyone help
me
> > out?
>
> (just a guess) try adding the table name, like: 'u.last_name'.
>
> --
> -Alfred Perlstein - [bright(at)wintelcom(dot)net|alfred(at)freebsd(dot)org]
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Renaud Tthonnart 2001-02-26 14:34:50 Nested tables
Previous Message Richard Huxton 2001-02-26 14:02:21 Re: Problem with host connection