Re: JSON and Postgres Variable Queries

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: JSON and Postgres Variable Queries
Дата
Msg-id 16964.1403540219@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: JSON and Postgres Variable Queries  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> You might find a sub-SELECT helpful:

> SELECT * FROM (SELECT json_data->>’plan'->>’id' as plan_id FROM
> orders) x WHERE plan_id = 1

> It might be a generally useful thing for WHERE-clause items to be able
> to reference items from the target list by alias, or maybe it's
> problematic for some reason that I don't know about,

Standards compliance?  It's not just a trivial syntactic issue either,
but a rather fundamental conceptual one: expressions in the target list
are not supposed to be evaluated until after the WHERE clause is.
        regards, tom lane



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: How about a proper TEMPORARY TABLESPACE?
Следующее
От: "MauMau"
Дата:
Сообщение: Re: Use a signal to trigger a memory context dump?