Hacker News new | ask | show | jobs
by tobias_irmer 1631 days ago
I haven't used that, yet. But this has me confused:

"An automatically updatable view may contain a mix of updatable and non-updatable columns. A column is updatable if it is a simple reference to an updatable column of the underlying base relation; otherwise the column is read-only, and an error will be raised if an INSERT or UPDATE statement attempts to assign a value to it."

Isn't splitting full_name into two columns a complex reference (for lack of a better word)?

1 comments

Actually, no! That's because from the perspective of the view, it's simply directly referencing a table and some columns, it doesn't handle any of the updating.

What Reshape does is that it sets up triggers for the underlying table. When an insert is made, the trigger runs and updates the other columns directly on the table, which has no effect on the view.