Re: COUNT(*) to find records which have a certain number of dependencies

Поиск
Список
Период
Сортировка
От Mischa Sandberg
Тема Re: COUNT(*) to find records which have a certain number of dependencies
Дата
Msg-id YK14d.106472$XP3.11314@edtnps84
обсуждение исходный текст
Ответ на Re: COUNT(*) to find records which have a certain number of dependencies ?  (Greg Stark <gsstark@mit.edu>)
Ответы Re: COUNT(*) to find records which have a certain number of dependencies
Список pgsql-sql
Greg Stark wrote:
> T E Schmitz <mailreg@numerixtechnology.de> writes:

>>) as somealias on (model_fk = model_pk)
>>(subquery in FROM must have an alias)
> 
> ARGH! This is one of the most annoying things about postgres! It bites me all
> the time. Obviously it's totally insignificant since it's easy for my to just
> throw an "AS x" on the end of it. But damn.
> 
> So where can I officially register my complaint? :)

Hope you don't mind an opinion from someone who looks at this from the 
underside ...

Trying to give the parser a better chance of confusing you?

Having the tag only totally insignificant if you want to have a bunch of 
special validation cases, where if there is only ONE anonymous 
pseudotable, and no ambiguity is possible.

If all it does is give you an annoying but understandable error message,  might you care to consider the cryptic error
messagesyou get from 
 
systems that try to 'do what you mean, not what you say' for such 
special cases ... and thereby turn a typo into an error twenty lines 
further down the page.

BTW, the "as" is optional, but I always suggest that people use it 
explicitly. Why? Because without it, you get another silly error message 
or even a runtime error when what you did was omit a comma. For example
select salary name from Employee

returns one column (a dollar figure called "name").
(Yes, I know it's harder to cook up an example when the comma is missing    between tables in the FROM list; just
wantedit to be obvious)
 

Okay, apologies for what may sound like a rant.
I've just been wrangling with an interpreter that tries WAY too hard to 
make something executable out of what you tell it ... even if that's 
really nothing like your intent.


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

Предыдущее
От: Martin Knipper
Дата:
Сообщение: Re: COUNT(*) to find records which have a certain number of
Следующее
От: Cris Carampa
Дата:
Сообщение: where clause on a left outer join