BUG #18546: Attempt to insert default into a non-updatable column of a view fails with a dubious error
The Post Office <noreply@postgresql.org>
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: exclusion@gmail.com
Date: 2024-07-20T09:00:01Z
Lists: pgsql-bugs
The following bug has been logged on the website: Bug reference: 18546 Logged by: Alexander Lakhin Email address: exclusion@gmail.com PostgreSQL version: 17beta2 Operating system: Ubuntu 22.04 Description: The following query: CREATE TABLE t (a int); CREATE VIEW v AS SELECT a, a + 0 AS a0 FROM t; INSERT INTO v values (default, default); raises ERROR: XX000: attribute number 2 not found in view targetlist LOCATION: adjust_view_column_set, rewriteHandler.c:3045 Whilst INSERT INTO v values (default, 1); fails with clearer ERROR: 0A000: cannot insert into column "a0" of view "v" DETAIL: View columns that are not columns of their base relation are not updatable.
Commits
-
Correctly check updatability of columns targeted by INSERT...DEFAULT.
- feca6c688cd9 12.20 landed
- fd958bbbdf20 16.4 landed
- 96953052a12c 15.8 landed
- 461f47948553 13.16 landed
- 220003b9b937 18.0 landed
- 0d712ec12a90 14.13 landed
- 041a00c4803b 17.0 landed