Re: BUG #18546: Attempt to insert default into a non-updatable column of a view fails with a dubious error

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: exclusion(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18546: Attempt to insert default into a non-updatable column of a view fails with a dubious error
Date: 2024-07-22 08:41:11
Message-ID: CAEZATCWLfKrE7m0pNMD3-5GCk=swfZWUMmatvHqDPMO9KNa3Vg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, 20 Jul 2024 at 17:26, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> The existing code/comments (dating AFAICS to Dean's cab5dc5da)
> already point out that rewriteTargetListIU can add targetlist items,
> but we missed the fact that it can delete them too. So it seems like
> what we need to do is union the original set of target columns with
> what's listed in the targetlist, as attached.
>

Ah yes, that makes sense and the fix looks good. Thanks for taking care of that.

I had always thought that rewriteTargetListIU() only ever added or
merged items, somehow overlooking the fact that it could also delete
them. In my defence, it's very easy to get that impression just by
reading the function's comments. I think it's worth updating those
comments to mention that. Something like the attached, perhaps.

Regards,
Dean

Attachment Content-Type Size
comment-update-for-bug-18546.patch text/x-patch 2.3 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrew Dunstan 2024-07-22 11:24:21 Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Previous Message Jason ChenTJ (CN) 2024-07-22 02:51:35 回复: [External]Re: BUG #18540: Does PG16 standby database support function pg_replication_origin_advance?