From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | Leif K-Brooks <eurleif(at)ecritters(dot)biz> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Automatic joins? |
Date: | 2004-01-18 00:58:43 |
Message-ID: | 20040118005843.GB31106@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I think what is being referred to is that other types can be embedded
directly into the columns of a table. So in the second query the "address"
referred to is a column of the user table, not a table in itself.
I think Postgres may have supported this but PostgreSQL certainly hasn't for
a very long time, if at all. Although apparently it wouldn't be that
difficult to resurrect, just that nobody has done it.
Just think about how it would be returned through the libpq interface if you
did a SELECT * on the table.
Good luck,
On Sat, Jan 17, 2004 at 11:47:18PM +0000, Leif K-Brooks wrote:
> According to the Wikipedia article on PostgreSQL
> (http://en.wikipedia.org/wiki/PostgreSQL) it has a feature for
> automatic joins:
>
> "SELECT u.* FROM user u, address a WHERE a.city='New York' and
> a.user_name=u.user_name
>
> In Postgres the relationship between users and addresses can be
> explicity defined. Once defined the address becomes a property of the
> user, so the search above can be simplified greatly to:
>
> SELECT * FROM user WHERE address.city='New York'"
>
> Is the a load of nonsense, or am I doing something wrong? I did define a
> foreign key, but it doesn't work.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> (... have gone from d-i being barely usable even by its developers
> anywhere, to being about 20% done. Sweet. And the last 80% usually takes
> 20% of the time, too, right?) -- Anthony Towns, debian-devel-announce
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2004-01-18 03:27:09 | Re: importing data |
Previous Message | Mental | 2004-01-18 00:26:25 | importing data |