SQL Debugging Aide

Поиск
Список
Период
Сортировка
От Mike Mascari
Тема SQL Debugging Aide
Дата
Msg-id 3B85104B.7006EE72@mascari.com
обсуждение исходный текст
Список pgsql-general
Is there any option that one might set to have PostgreSQL emit a
NOTICE when it encounters a SELECT statement having a table not
involved in any join condition?

For example, if I do:

SELECT employees.name
FROM employees, salaries;

It would aide debugging application development a bit if there was a
way to have PostgreSQL emit a NOTICE like:

NOTICE: Cartesian product generated for table 'salaries'

in the same manner that it now adds a notice for missing FROM clause
entries.

I realize that there are queries like the above where the results
are as expected, which is why it would be nice for it to be some
option. The above is obvious, but some of my queries contain joins
with > 15 tables. In development, when some of the tables are empty
or only contain 1 record, the results may appear to work. Only until
later would I discover a missing join condition when more then 1 row
is added.

Just a thought,

Mike Mascari
mascarm@mascari.com

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

Предыдущее
От: Fernando Schapachnik
Дата:
Сообщение: Re: Postgres and special character
Следующее
От: "Andrew Snow"
Дата:
Сообщение: RE: Re: SELECT FOR UPDATE