pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Tender Wang <tndrwang@gmail.com>
Cc: Alexander Lakhin <exclusion@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18310: Some SQL commands fail to process duplicate objects with error: tuple already updated by self
Date: Mon, 29 Jan 2024 08:34:02 +0900
Message-ID: <ZbbkaguEsLj42Spb@paquier.xyz> (raw)
In-Reply-To: <CAHewXNnK9JShDv6cffAQgQNDb3RPq6M+LHRC16U=1-bUPZYU7g@mail.gmail.com>
References: <18310-1eb233c5908189c8@postgresql.org>
	<ZbMeI3EyyDlP-Agv@paquier.xyz>
	<CAHewXNnK9JShDv6cffAQgQNDb3RPq6M+LHRC16U=1-bUPZYU7g@mail.gmail.com>

On Fri, Jan 26, 2024 at 11:23:08AM +0800, Tender Wang wrote:
> Michael Paquier <michael@paquier.xyz> 于2024年1月26日周五 10:51写道:
>> For this job, I think user.c is just overengineered and could be
>> simplified to use a list of OIDs.  There is no need for ObjectAddress
>> or even ObjectAddresses: all of them are created with
>> AuthIdRelationId as class ID, and the second loop just fetches the
>> role IDs retrieved from the ObjectAddresses created in the first loop.
>> We don't use the individual ObjectAddress either.  On top of all that,
>> it makes the code a bit easier to follow.
> 
> Agreed. +1

Thanks, I've applied this one down v16 as of 50b797dc99ec.  v15 and
older do not use a two-pass logic in DropRole() so one would fail with
a simpler "role does not exist", which is kind of correct in its own
way because the second role cannot be scanned in pg_authid after the
CCI of the first one, so I have let it be in older versions.  It's not
like somebody complained about that in the past, either, as far as I
recall.
--
Michael

Attachments:

  [application/pgp-signature] signature.asc (832B, ../ZbbkaguEsLj42Spb@paquier.xyz/2-signature.asc)
  download

view thread (20+ messages)  latest in thread

Message-ID: <ZbbkaguEsLj42Spb@paquier.xyz>
Permalink:  ../ZbbkaguEsLj42Spb@paquier.xyz/
Also on:    postgresql.org/message-id/ZbbkaguEsLj42Spb@paquier.xyz

 · 

reply

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: michael@paquier.xyz, tndrwang@gmail.com, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18310: Some SQL commands fail to process duplicate objects with error: tuple already updated by self
  In-Reply-To: <ZbbkaguEsLj42Spb@paquier.xyz>

* 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