Re: Rules UPDATE
От
Gnanavel S
Тема
Re: Rules UPDATE
Дата
Msg-id
eec3b03c05082205253652d690@mail.gmail.com
Ответ на
Rules UPDATE (Pailloncy Jean-Gerard)
Список
Дерево обсуждения
Rules UPDATE Pailloncy Jean-Gerard <jg@rilk.com>
Re: Rules UPDATE Gnanavel S <s.gnanavel@gmail.com>
On 8/22/05, Pailloncy Jean-Gerard <jg@rilk.com> wrote:
Hi,
With PostgreSQL 7.4.6.
I have a table aaa (id serial, maj timestamp without time zone)
I defined to function from_timestamp and to_timestamp to do
conversion between text and timestamp with few checks and tricks.
I defined a view aab (id serial, maj text) as "SELECT id,
from_timestamp(maj) AS maj FROM aaa;"
I defined a rule UPDATE on aab as "CREATE RULE aab_update AS ON
UPDATE TO aab DO INSTEAD UPDATE aaa SET id = new.id, maj =
to_timestamp(new.maj);"
Now, when I do
UPDATE aab SET maj='1990-00-00' WHERE id<9
all the rows of aaa are updated. The condition "id<9" is not used.
Any help is welcome.
Cordialement,
Jean-Gérard Pailloncy
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
--
with regards,
S.Gnanavel
Satyam Computer Services Ltd.
В списке pgsql-general по дате отправления