Re: bad variable subst after "AS"

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: bad variable subst after "AS"
Дата
Msg-id 1284649877-sup-6411@alvh.no-ip.org
обсуждение исходный текст
Ответ на bad variable subst after "AS"  (Darren Duncan <darren@darrenduncan.net>)
Ответы Re: bad variable subst after "AS"  (Darren Duncan <darren@darrenduncan.net>)
Список pgsql-hackers
Excerpts from Darren Duncan's message of jue sep 16 02:33:37 -0400 2010:

> My impression of this is that Pg is treating the "a1" after the "AS" like it was
> a variable reference and so substituted it for $1.

Yes.

> Now that just seems wrong to me.  I can understand either "a0" or "rv" getting a
> substitution, but something following an "AS" being substituted is just wrong.
> 
> Is that a bug and if not then what is the rationale for working that way, and
> can it be changed?

Fixed in 9.0.

> Meanwhile, what is the best way to write f to work around this misbehavior?

Give the column a different alias, one not colliding with a variable name.

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: autonomous transactions
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: [BUGS] BUG #5305: Postgres service stops when closing Windows session