Delete row from table which is linked to a view still not possible?

Delete row from table which is linked to a view still not possible?

Koen VerhoevenKoen Verhoeven Posts: 25Questions: 7Answers: 0

I found this discussion: https://datatables.net/forums/discussion/26464/problem-deleting-a-row-from-table-which-is-linked-to-a-view
which is supposed to be solved, but I do encounter exactly the same issue. The only difference I can find is I am using a Postgres database connection.

SQLSTATE[55000]: Object not in prerequisite state: 7 ERROR: cannot delete from view "lookupview" DETAIL: Views that do not select from a single table or view are not automatically updatable. HINT: To enable deleting from the view, provide an INSTEAD OF DELETE trigger or an unconditional ON DELETE DO INSTEAD rule.

Answers

  • Koen VerhoevenKoen Verhoeven Posts: 25Questions: 7Answers: 0

    I found a solution for now by removing a join in my view. Somehow when deleting a row from the table, this also triggers the view to delete the row. If this view contains a join, this does not work (logically). So I found a work-around, but it would be good if Datatables has an option which only deletes the row from the table, without triggering the views.

  • allanallan Posts: 61,716Questions: 1Answers: 10,108 Site admin

    Thanks for posting back - great to hear you found a workaround.

    I will certainly look at the options for improving this area of Editor.

    Regards,
    Allan

This discussion has been closed.