Re: partitioning / rules - strange behavior

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема Re: partitioning / rules - strange behavior
Дата
Msg-id 45CA5063.7010405@fuzzy.cz
обсуждение исходный текст
Ответ на Re: partitioning / rules - strange behavior  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: partitioning / rules - strange behavior  (Tomas Vondra <tv@fuzzy.cz>)
Список pgsql-general
>> But I don't understand why the nextval('sessions_id_seq') is evaluated
>> multiple times? Even when I do
>
> RULE expand like macros, so every expression passed in is simply copied
> to each place, leading to multiple evaluations.
>
> If you've played with the C preprocessor: that has the same basic
> problem.
>
> It's rather unexpected for novices, which is why triggers are usually
> recommended.

I wouldn't call myself a novice, but yes - this surprised me a little.
Now it seems so natural ... I think there should be a clear explanation
/ example in the docs about this - I've read the documentation on RULE
sytem several times and as far as I remember.

Anyway thanks to those helped me to solve this problem, now it works as
expected.

Tomas


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

Предыдущее
От: rob_spellberg
Дата:
Сообщение: a request for the 8.1.7 and 8.2.2 tarballs and the good reasons why
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: partitioning / rules - strange behavior