help with simple rule

Поиск
Список
Период
Сортировка
От Chris Hayner
Тема help with simple rule
Дата
Msg-id Pine.OSF.4.32.0103121459490.18676-100000@typhoon.ocis.temple.edu
обсуждение исходный текст
Ответы Re: help with simple rule
Список pgsql-general
here is the table:

                  Table "testx"
     Attribute |  Type   |      Modifier
    -----------+---------+--------------------
     starter   | integer | not null
     second    | text    | default timestamp('now')

I am trying to make a rule which states:

    whenever someone UPDATES starter, UPDATE second with the current
    timestamp.

here is my attempt at it:

    CREATE RULE testx_update AS ON UPDATE TO testx WHERE (new.starter
    <> old.starter) DO UPDATE testx SET "second" = timestamp('now');

here is the error i am recieving:

    backend=# update testx SET starter =21910 where second = '10000000';
    ERROR:  query rewritten 10 times, may contain cycles

here is my plea for help:

    help!!! ;) seriously, i haven't been able to get this to work and
    i do not know why. any help that anyone can give me would be
    greatly appreciated.


TIA,

--ch



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pqReadData() - backend unexpectedly closed the channel
Следующее
От: "Rob Arnold"
Дата:
Сообщение: Re: [SQL] Permissons on database