Re: wildcard alias - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: wildcard alias
Date
Msg-id 20061110223422.GC18137@svana.org
Whole thread Raw
In response to wildcard alias  (Matthew Terenzio <matt@jobsforge.com>)
Responses Re: wildcard alias  ("Joshua D. Drake" <jd@commandprompt.com>)
List pgsql-general
I don't know what your query or aliases have to do with joins, but if
you want to join two tables on all fields with the same name, you can
do a NATURAL JOIN.

Have a nice day,

On Fri, Nov 10, 2006 at 05:17:12PM -0500, Matthew Terenzio wrote:
>
> I suppose I should have named things differently but is there a way to
> join two tables with a bunch of identical column names and rather than
> explicitly alias each column just use some sort of wildcard like:
>
> SELECT tablename.* AS  alias.*
>
> OR do I have to name each column like:
>
> columnname as alias
>
> Thanks much.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>       choose an index scan if your joining column's datatypes do not
>       match

--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: Matthew Terenzio
Date:
Subject: wildcard alias
Next
From: "George Pavlov"
Date:
Subject: apparent wraparound