Updatable Views and INSERT INTO ... ON CONFLICT - Mailing list pgsql-hackers

From Joel Jacobson
Subject Updatable Views and INSERT INTO ... ON CONFLICT
Date
Msg-id ddd29182-86fb-4c2b-a930-85dcfe2272d0@www.fastmail.com
Whole thread Raw
Responses Re: Updatable Views and INSERT INTO ... ON CONFLICT
List pgsql-hackers
Hi,

I note it's not yet possible to INSERT INTO an Updatable View using the ON CONFLICT feature.

One imaginable pattern is when a user wants to refactor by renaming a table,
but for some reason cannot refactor some specific application and want to
allow it to continue to use the table's old name.

One approach to do so would be to create a an Updatable View (aka Simple view) [1],
given the same name as the table's old name.

This is ugly and not something I would do myself, but I've read about how others describe this pattern, not in the context of ON CONFLICT, but in general, when refactoring.

Are there reasons why it would not be possible to develop support INSERT INTO ... ON CONFLICT for Updatable Views?

Not saying it is desired, just trying to better understand the limits of Updatable Views.

/Joel

pgsql-hackers by date:

Previous
From: "Joel Jacobson"
Date:
Subject: Re: Foreign key joins revisited
Next
From: Zhihong Yu
Date:
Subject: Re: Collecting statistics about contents of JSONB columns