Re: list blocking queries

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: list blocking queries
Дата
Msg-id 11192.1328046183@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: list blocking queries  (Scot Kreienkamp <SKreien@la-z-boy.com>)
Список pgsql-general
Scot Kreienkamp <SKreien@la-z-boy.com> writes:
> There's something wrong with the query that I've written based on what you gave me.

It looks like you forgot the ON condition for the next-to-last JOIN,
so the parser is still expecting another ON when it runs into the WHERE.

Personally I think this sort of FROM construction is pretty bad style
anyway, because it takes an eagle eye to see which ON goes with which
JOIN, and even worse it's very easy to get them connected up wrongly.
You'd be a lot better off with explicit parentheses, viz

from
    (pg_catalog.pg_locks bl join pg_catalog.pg_stat_activity a on bl.pid = a.procpid)
  join
    (pg_catalog.pg_locks kl join pg_catalog.pg_stat_activity ka on kl.pid = ka.procpid)
  on the-long-on-condition-goes-here

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: EXT :Re: Intermittent occurrence of ERROR: could not open relation
Следующее
От: "Marc Mamin"
Дата:
Сообщение: Re: normalizing & join to table function