Re: alias not applied

From: "Sabin Coanda" <sabin(dot)coanda(at)deuromedia(dot)ro>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: alias not applied
Date: 2007-02-09 16:35:35
Message-ID: eqi7se$1lvd$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

You are right. I use "PostgreSQL 8.1.0 on i686-pc-mingw32, compiled by GCC
gcc.exe (GCC) 3.4.2 (mingw-special)" on Windows.

But I just tried it on a newer version and it works well ( "PostgreSQL 8.1.4
on i686-redhat-linux-gnu, compiled by GCC gcc (GCC) 4.0.2 20051125 (Red Hat
4.0.2-8)" ).

Thanks a lot,
Sabin

"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote in message
news:961(dot)1171038340(at)sss(dot)pgh(dot)pa(dot)us(dot)(dot)(dot)
> "Sabin Coanda" <sabin(dot)coanda(at)deuromedia(dot)ro> writes:
>> I have two queries:
>
>> 1. SELECT i AS "PK_ID", d AS "Deleted" FROM ( SELECT 52 AS i, true AS
>> ) x
>> ORDER BY i
>> 2. SELECT i AS "PK_ID", d AS "Deleted" FROM ( SELECT 49 AS i, true AS d
>> UNION SELECT 51 AS i, true AS d ) x ORDER BY i
>
>> The first returns the columns "PK_ID", "Deleted"
>> The second returns the columns i, d.
>
> Works for me:
>
> regression=# SELECT i AS "PK_ID", d AS "Deleted" FROM ( SELECT 52 AS i,
> true AS d ) x ORDER BY i;
> PK_ID | Deleted
> -------+---------
> 52 | t
> (1 row)
>
> regression=# SELECT i AS "PK_ID", d AS "Deleted" FROM ( SELECT 49 AS i,
> true AS d UNION SELECT 51 AS i, true AS d ) x ORDER BY i;
> PK_ID | Deleted
> -------+---------
> 49 | t
> 51 | t
> (2 rows)
>
> regression=#
>
> What PG version are you using, exactly?
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ezequias Rodrigues da Rocha 2007-02-09 18:50:15 Have anyone this man e-mail ?
Previous Message Tom Lane 2007-02-09 16:25:40 Re: alias not applied