AW: [HACKERS] rules bug?

Поиск
Список
Период
Сортировка
Искать
От
Zeugswetter Andreas IZ5
Тема
AW: [HACKERS] rules bug?
Дата
Msg-id
219F68D65015D011A8E000006F8590C60267B353@sdexcsrv1.f000.d0188.sd.spardat.at
Список
Дерево обсуждения
AW: [HACKERS] rules bug? Zeugswetter Andreas IZ5 <Andreas.Zeugswetter@telecom.at>
Re: AW: [HACKERS] rules bug? Brook Milligan <brook@trillium.NMSU.Edu>
> 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
FAQ