Re: DO INSTEAD and conditional rules

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: DO INSTEAD and conditional rules
Дата
Msg-id 9287.1114539616@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: DO INSTEAD and conditional rules  (David Wheeler <david@kineticode.com>)
Ответы Re: DO INSTEAD and conditional rules  (David Wheeler <david@kineticode.com>)
Список pgsql-hackers
David Wheeler <david@kineticode.com> writes:
> On Apr 26, 2005, at 8:55 AM, Tom Lane wrote:
>> Well, they handle simple situations OK, but we keep seeing people get
>> burnt as soon as they venture into interesting territory.

> [ snip ]

> Ah, yes, you're right, that is...unexpected. Perhaps OLD can contain 
> its values for the duration of the RULE's statements? I'm assuming that 
> what's happening is that OLD.id is NULL after the first of the two 
> DELETE statements...

The problem is that OLD is effectively a macro for the view, and once
you've deleted one of the rows, that ID is no longer present anywhere in
the view.  Sometimes you can work around this by making the join an
outer join, but that's certainly a kluge.

>> Like I said, I don't have a better idea.  Just a vague feeling of
>> dissatisfaction.

> I'd call it a bug. ;-)

I don't think it's fixable without a fundamental rethinking of the
feature.
        regards, tom lane


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

Предыдущее
От: David Wheeler
Дата:
Сообщение: Re: DO INSTEAD and conditional rules
Следующее
От: Rod Taylor
Дата:
Сообщение: pg_restore stuck in a loop?