-1

Possible Duplicate:
Cannot update view?

My site was developing using Drupal version 6 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 (from SELECT version()).

My problem is when I update a record it shows a failed error. Is there any mistake in my query?

The query is:

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?

Community
  • 1
  • 1
srinu
  • 259
  • 3
  • 7
  • 14
  • I'm confused; didn't you post this before? I don't see it in your post history, but I've seen this *exact* question before. Yes, here it is: http://stackoverflow.com/q/13151566/398670 . Is this you: http://stackoverflow.com/users/1119497/srinu? – Craig Ringer Nov 01 '12 at 04:56
  • 1
    Also related: http://stackoverflow.com/a/13151381/398670, http://bytes.com/topic/postgresql/answers/944071-update-problem-postgresql-db, http://forums.devshed.com/postgresql-help-21/how-to-update-a-view-933254.html . Are these your posts too? They're all recent and all much the same. If you aren't @srinu, did you search before posting? – Craig Ringer Nov 01 '12 at 04:59

1 Answers1

1

A view is just that: a different way of looking at something else.

Don't update the view; update whatever table(s) the view is based at. (See also Cannot update view?)

Community
  • 1
  • 1
Matt Ball
  • 354,903
  • 100
  • 647
  • 710
  • thank you, your link helped me. – srinu Nov 01 '12 at 04:56
  • Do you realize that the link is to a question pretty much identical to this one, **asked by you?** – Matt Ball Nov 01 '12 at 11:49
  • no sir actually two members are working on this,so they also ask same question to you. – srinu Nov 05 '12 at 12:34
  • by using joins we can update a view. – srinu Nov 06 '12 at 05:56
  • That does not make any sense. Exactly how does one use a join to update a view? – Matt Ball Nov 06 '12 at 12:08
  • there is a common field in parent table and view so by using left join i updated the view.i use the following query to update view $query = "select a.nid,a.status,a.editiontitle,a.uac_edition_details_editiontype,b.title from uac_institution_view as a LEFT JOIN node as b on b.nid = a.nid where a.status='1' order by a.uac_edition_details_editiontype asc, a.editiontitle asc, a.title asc"; – srinu Nov 07 '12 at 03:45