From: | Gnanavel S <s(dot)gnanavel(at)gmail(dot)com> |
---|---|
To: | Pailloncy Jean-Gerard <jg(at)rilk(dot)com> |
Cc: | Postgres mailing list general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Rules UPDATE |
Date: | 2005-08-22 12:25:06 |
Message-ID: | eec3b03c05082205253652d690@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 8/22/05, Pailloncy Jean-Gerard <jg(at)rilk(dot)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 <http://new.id>, maj =
> to_timestamp(new.maj);"
add the foll. where condition in rule
where id=new.id <http://new.id>
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.
From | Date | Subject | |
---|---|---|---|
Next Message | Sean Davis | 2005-08-22 12:36:41 | Re: SQL error - please help. |
Previous Message | Bernard | 2005-08-22 12:24:53 | SQL error - please help. |