From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: exclusion@gmail.com
Subject: BUG #18546: Attempt to insert default into a non-updatable column of a view fails with a dubious error
Date: Sat, 20 Jul 2024 09:00:01 +0000
Message-ID: <18546-84a292e759a9361d@postgresql.org> (raw)
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, exclusion@gmail.com
Subject: Re: BUG #18546: Attempt to insert default into a non-updatable column of a view fails with a dubious error
In-Reply-To: <18546-84a292e759a9361d@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox