Re: [GENERAL] Count(*) throws error
От
Richard Huxton
Тема
Re: [GENERAL] Count(*) throws error
Дата
Msg-id
46966ED5.4080204@archonet.com
Ответ на
Re: [GENERAL] Count(*) throws error (Tom Lane)
Список
Дерево обсуждения
Re: [GENERAL] Count(*) throws error "Simon Riggs" <simon@2ndquadrant.com>
Re: [GENERAL] Count(*) throws error Tom Lane <tgl@sss.pgh.pa.us>
Re: [GENERAL] Count(*) throws error "Simon Riggs" <simon@2ndquadrant.com>
Re: [GENERAL] Count(*) throws error Tom Lane <tgl@sss.pgh.pa.us>
Re: [GENERAL] Count(*) throws error Gregory Stark <stark@enterprisedb.com>
Re: [GENERAL] Count(*) throws error Tom Lane <tgl@sss.pgh.pa.us>
Re: [GENERAL] Count(*) throws error Richard Huxton <dev@archonet.com>
Re: [GENERAL] Count(*) throws error Tom Lane <tgl@sss.pgh.pa.us>
Re: [GENERAL] Count(*) throws error Gregory Stark <stark@enterprisedb.com>
Re: [GENERAL] Count(*) throws error Tom Lane <tgl@sss.pgh.pa.us>
Tom Lane wrote:
> Again, I'm trying to look at the big picture of both syntactic and
> semantic errors. If we solve only the syntactic end of it I think we'd
> actually be worse off, because then users would be even more lost when
> they hit a semantic error (unwanted substitution).
The only real solution is to have some clear syntactic sugar denoting
where variables are to be interpolated: SELECT * FROM foo WHERE (bar + 1) = bar -- Which is the var? SELECT * FROM foo WHERE (bar + 1) = $bar -- OK SELECT * FROM foo WHERE (bar + 1) = {bar} -- OK
It's not clear to plpgsql because it's *not clear*.
In any other namespace-conflict situation I can think of it's always
inner-definition-is-visible. This would of course solve the problem, but only by preventing you from substituting in variables that conflict
with columns. Unless you generate a warning at function compile-time
that doesn't seem much better.
-- Richard Huxton Archonet Ltd
В списке pgsql-hackers по дате отправления
От: Tom Lane
Дата: