Re: Automatic joins?

Поиск
Список
Период
Сортировка
От Martín Marqués
Тема Re: Automatic joins?
Дата
Msg-id 1074437457.400a9d51292a0@bugs.unl.edu.ar
обсуждение исходный текст
Ответ на Automatic joins?  (Leif K-Brooks <eurleif@ecritters.biz>)
Список pgsql-general
Mensaje citado por Leif K-Brooks <eurleif@ecritters.biz>:

> 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'"

I find this totally untrue (un less I missundertud it). Check this out:

siprebi=> select version();
                                              version
---------------------------------------------------------------------------------------------------
 PostgreSQL 7.3.4 on sparc-unknown-linux-gnu, compiled by GCC sparc-linux-gcc
(GCC) 3.3.2 (Debian)
(1 row)

siprebi=> select a.nombre from admin a, biblioteca b where b.codigo = 3 and
b.codigo = a.biblioteca;
 nombre
--------
(0 rows)

siprebi=> select a.nombre from admin a, biblioteca b where b.codigo = 3;
      nombre
-------------------
 Andres C. Roman
 Martin Marques
 Mariano Markowsky
(3 rows)

siprebi=> select a.nombre from admin a where biblioteca.codigo = 3;
NOTICE:  Adding missing FROM-clause entry for table "biblioteca"
      nombre
-------------------
 Andres C. Roman
 Martin Marques
 Mariano Markowsky
(3 rows)

siprebi=> select a.nombre from admin a;
      nombre
-------------------
 Andres C. Roman
 Martin Marques
 Mariano Markowsky
(3 rows)

As you see, no automatic join was performed. Who wrote that article? I see that
example, at least poorly written, if not inaccurate.

--
select 'mmarques' || '@' || 'unl.edu.ar' AS email;
-------------------------------------------------------
Martín Marqués          |   Programador, DBA
Centro de Telemática    |     Administrador
               Universidad Nacional
                    del Litoral
-------------------------------------------------------

В списке pgsql-general по дате отправления:

Предыдущее
От: Bill Moran
Дата:
Сообщение: Using a Makefile during database development
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Tool to ease development of plpgsql