AW: [HACKERS] rules bug?

Поиск
Список
Период
Сортировка
От Zeugswetter Andreas IZ5
Тема AW: [HACKERS] rules bug?
Дата
Msg-id 219F68D65015D011A8E000006F8590C60267B353@sdexcsrv1.f000.d0188.sd.spardat.at
обсуждение исходный текст
Ответы Re: AW: [HACKERS] rules bug?  (Brook Milligan <brook@trillium.NMSU.Edu>)
Список pgsql-hackers
> create rule surveys_ins as on insert to surveys
> do instead
> insert into survey_data (survey_date, name)
>     select new.survey_date, new.name where not exists
>     (select * from survey_data d where d.survey_date = new.survey_date
> and d.name = new.name);
> 
Since this is a rewrite rule, the whole statement gets rewritten, thus 
leading to different results, when one statement inserts many rows (insert
into ... select)
or one statement only inserts one row (insert ...).

The "problem" is visibility of data. The rows that have already been
inserted by this 
same statement (insert ...select) are not visible to the restricting select.

Andreas 



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

Предыдущее
От: Dmitry Samersoff
Дата:
Сообщение: Re: [HACKERS] EGCS becomes GCC
Следующее
От: Oleg Bartunov
Дата:
Сообщение: Re: [HACKERS] EGCS becomes GCC