Re: COPY into a view; help w. design & patch

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: COPY into a view; help w. design & patch
Дата
Msg-id 15765.1179773976@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: COPY into a view; help w. design & patch  ("Karl O. Pinc" <kop@meme.com>)
Ответы Re: COPY into a view; help w. design & patch  ("Karl O. Pinc" <kop@meme.com>)
Список pgsql-hackers
"Karl O. Pinc" <kop@meme.com> writes:
> When I say I write and execute an INSERT statement I mean
> that the INSERT statement into the view is executed just as if the user
> wrote it -- it is passed through the rule system and turns into
> whatever INSERT or other statements the user has
> associated with INSERTing into the view.

The problem with this line of argument is that it starts from the premise
that rule support for INSERTs is fine and dandy, and all we lack is that
COPY isn't paying attention to it.  This premise is not in accord with
reality --- reality is that the rule system sucks for a number of
reasons, the main one being multiple-evaluation risks.  I can't count
how many times I've told newbies to forget trying to use a rule and
instead use a trigger for whatever they were trying to accomplish.
Take a look also at the so-far-failed attempts to implement SQL-spec
updatable views on the basis of the current rule system.

I think that the wave of the future is probably to figure out a way to
provide trigger support for views.  Or maybe we must throw out the
current rule system and start over.  Neither plan makes it sound
attractive to make COPY depend on the current rule system.
        regards, tom lane


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: pg_get_tabledef
Следующее
От: "Karl O. Pinc"
Дата:
Сообщение: Re: COPY into a view; help w. design & patch