#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    2
    Rep Power
    0

    How to update a view?


    Hi my site was developing using drupal6 and db is PostgreSQL 8.3.8 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real (Ubuntu 4.4.1-3ubuntu3) 4.4.1
    My problem is when i update a record it shows a failed error,is there any mistake in my query,and the query was
    UPDATE uac_institution_view SET status = '2' WHERE nid = '9950'
    and the error is:
    failed : ERROR: infinite recursion detected in rules for relation "uac_institution_view"
    i am new in this db can any one help me how to update a view.
    Thank you.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2010
    Posts
    15
    Rep Power
    0
    Hi,

    A VIEW monitor the result of an SQL statement in a table, they are read only.
    I would suggest to update the main source table of the view.

    Hope this gives you an idea.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,784
    Rep Power
    348
    Originally Posted by bsrbvr
    failed : ERROR: infinite recursion detected in rules for relation "uac_institution_view"
    i am new in this db can any one help me how to update a view.
    Thank you.
    So you have a RULE defined for that view which tries to update the underlying table. And that's where the error arises.

    You have to show us the code of those rules, otherwise nobody will be able to help you.

    Originally Posted by rtz_andy
    A VIEW monitor the result of an SQL statement in a table, they are read only.
    That's plain wrong.
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags.
    http://forums.devshed.com/misc.php?do=bbcode#code

    Tips on how to ask better questions:
    http://tkyte.blogspot.de/2005/06/how-to-ask-questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html

IMN logo majestic logo threadwatch logo seochat tools logo