Composite types for updatable views

From: Malthe <mborch(at)gmail(dot)com>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Composite types for updatable views
Date: 2025-07-16 12:06:48
Message-ID: CAAPh5F=uZwhyXD9Fm9WoJRPkaueGs0LgedAVP1R8ToHRVNwYhA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

While simple views are automatically updatable [1], this does not extend to
composite types; that is, if a view constructs a composite type for one or
more columns, this column then is not updatable:

> A column is updatable if it is a simple reference to an updatable column
of the underlying base relation

It would seem simple enough to support composite types if the view column
is constructed using row expression in which each field is "a simple
reference to an updatable column".

As a practical example, this could enable geometric types being exposed at
the view layer, but supported in an underlying table by primitive types.

[1]
https://www.postgresql.org/docs/current/sql-createview.html#SQL-CREATEVIEW-UPDATABLE-VIEWS

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2025-07-16 12:25:15 Re: Question on any plans to use the Create Server/Create blink_ Mapping to provide Logical Replication Subscriptions the user/password in an encrypted manner
Previous Message Euler Taveira 2025-07-16 12:01:37 event trigger support for PL/Python