Re: Query issue/8.0.1/Serendipity

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Query issue/8.0.1/Serendipity
Дата
Msg-id 6329.1110296271@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Query issue/8.0.1/Serendipity  (Larry Rosenman <ler@lerctr.org>)
Ответы Re: Query issue/8.0.1/Serendipity
Re: Query issue/8.0.1/Serendipity
Список pgsql-sql
Larry Rosenman <ler@lerctr.org> writes:
> I have an 8.0.1 server running the Blogging software serendipity, and the 
> following query fails with "relation e not defined", but it is on the first 
> line:

> "SELECT timestamp FROM serendipity_entries e, serendipity_category c,
> serendipity_entrycat ec LEFT OUTER JOIN serendipity_entryproperties
> ep_cache_extended ON (e.id = ep_cache_extended.entryid AND
> ep_cache_extended.property = 'ep_cache_extended') ...

Broken SQL that's only ever been tested on MySQL.

Last I heard, MySQL treated this sort of construct as joining
left-to-right, ie,
FROM e CROSS JOIN c CROSS JOIN ec LEFT JOIN ...

in which case the left argument of the LEFT JOIN already contains
e, c, and ec so it's OK for the JOIN condition to use e.  Unfortunately
for MySQL users everywhere, this is expressly contrary to the SQL spec:
per spec, JOIN binds more tightly than commas in the FROM-list do.

(Is this on the mysql gotchas page?)
        regards, tom lane


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

Предыдущее
От: Larry Rosenman
Дата:
Сообщение: Re: Query issue/8.0.1/Serendipity
Следующее
От: Larry Rosenman
Дата:
Сообщение: Re: Query issue/8.0.1/Serendipity