pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mischa Sandberg <ischamay.andbergsay@activestateway.com>
To: pgsql-sql@postgresql.org
Subject: Re: COUNT(*) to find records which have a certain number of dependencies
Date: Tue, 21 Sep 2004 22:16:24 GMT
Message-ID: <YK14d.106472$XP3.11314@edtnps84> (raw)
In-Reply-To: <877jqohdoj.fsf@stark.xeocode.com>
References: <414EF3E6.9040202@numerixtechnology.de>
	<87llf4hjv2.fsf@stark.xeocode.com>
	<414F348A.2020608@numerixtechnology.de>
	<877jqohdoj.fsf@stark.xeocode.com>

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 messages you 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 wanted it 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.



view thread (16+ messages)  latest in thread

Message-ID: <YK14d.106472$XP3.11314@edtnps84>
Permalink:  ../YK14d.106472$XP3.11314@edtnps84/
Also on:    postgresql.org/message-id/YK14d.106472$XP3.11314@edtnps84

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ischamay.andbergsay@activestateway.com
  Subject: Re: COUNT(*) to find records which have a certain number of dependencies
  In-Reply-To: <YK14d.106472$XP3.11314@edtnps84>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox