Re: Updates on Views?

Поиск
Список
Период
Сортировка
От will trillich
Тема Re: Updates on Views?
Дата
Msg-id 20010322220241.A15195@mail.serensoft.com
обсуждение исходный текст
Ответ на Re: Updates on Views?  (will trillich <will@serensoft.com>)
Ответы Re: Updates on Views?
Список pgsql-general
On Thu, Mar 22, 2001 at 07:14:49PM -0600, will trillich wrote:
>     CREATE VIEW who AS
>         SELECT * from _who;
>
>     CREATE RULE
>         who_insert
>     AS ON
>         INSERT TO who
>     DO INSTEAD
>         INSERT INTO "_who" (
>             login,
>             "password",
>             hint,
>             name,
>             email,
>             editor,
>             status,
>             modified,
>             created,
>             id
>         ) VALUES (
>             NEW.login,
>             NEW."password",
>             NEW.hint,
>             NEW.name,
>             NEW.email,
>             NEW.editor,
>             'U'::bpchar, -- uncertain until confirmed
>             "timestamp"('now'::text), -- last mod
>             "timestamp"('now'::text), -- created now
>             nextval('_who_id_seq'::text)
>     );
>     -- all non-mentioned fields from _who are silently
>     -- ignored (and dropped).

now that i think about it...

is it possible to have a rule DO INSTEAD more-than-one-thing?

    create rule split_it as
        on insert to someview
        do instead
            insert into tableone ....
            then
            intert into tabletwo ....
            then
            insert into tablethree ...
            then
            update someothertable ...

--
It is always hazardous to ask "Why?" in science, but it is often
interesting to do so just the same.
        -- Isaac Asimov, 'The Genetic Code'

will@serensoft.com
http://newbieDoc.sourceforge.net/ -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: psql slow connection
Следующее
От: Tom Lane
Дата:
Сообщение: Re: How to inspect blocked queries