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 <tgl@sss.pgh.pa.us>) |
| Список | pgsql-hackers |
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
fooWHERE (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
variablesthat conflict
with columns. Unless you generate a warning at function compile-time
that doesn't seem much better.
-- Richard Huxton Archonet Ltd
В списке pgsql-hackers по дате отправления: