Re: rules: evaluate inputs in advance

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: rules: evaluate inputs in advance
Дата
Msg-id 14284.1147623813@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: rules: evaluate inputs in advance  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
Martijn van Oosterhout <kleptog@svana.org> writes:
> Well, I notice that the SQL standard defines something called WITH, so
> what you want is something like:

> WITH OLD AS ( SELECT blah )
> DO
> ( UPDATE <rule1>
> ; DELETE <rule2> )

I think it'd be a mistake to assume that WITH would fix Markus'
complaint.  I haven't studied the spec in detail but I think that WITH
acts largely like a macro too.  It certainly doesn't have the behavior
of "evaluate this just once", as one of the prime uses for it is in
recursive query definition.

            regards, tom lane

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

Предыдущее
От: "Jaime Casanova"
Дата:
Сообщение: Re: Diferences between functions criated in pg 8.0.4 and criated in pg 7.4.8
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Cygwin psql with Windows native Postgres