Re: Supporting MERGE on updatable views

Dean Rasheed <dean.a.rasheed@gmail.com>

From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-12-21T20:04:26Z
Lists: pgsql-hackers

Attachments

On Thu, 8 Dec 2022 at 10:03, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
>
> Attached is a WIP patch, which I'll add to the next CF. I still need
> to do more testing, and update the docs, but so far, everything
> appears to work.
>

New patch attached with doc updates and a few other, mostly cosmetic, changes.

One notable change is that I realised that the check for rules on the
target table needs to be done in the rewriter, rather than the parser,
in case expanding a view hierarchy leads to base relations with rules
that the parser wouldn't notice.

Regards,
Dean

Commits

  1. Support MERGE into updatable views.

  2. Remove field UpdateContext->updated in nodeModifyTable.c

  3. Remove dummy_spinlock