Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mRdix-0008Fv-Kv for pgsql-general@arkaria.postgresql.org; Sat, 18 Sep 2021 17:01:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mRdiu-0000TN-ON for pgsql-general@arkaria.postgresql.org; Sat, 18 Sep 2021 17:01:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mRdiu-0000TE-FZ for pgsql-general@lists.postgresql.org; Sat, 18 Sep 2021 17:01:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mRdip-0003pM-9W for pgsql-general@lists.postgresql.org; Sat, 18 Sep 2021 17:01:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 18IH1m4L1488152; Sat, 18 Sep 2021 13:01:48 -0400 From: Tom Lane To: Tobias Meyer cc: pgsql-general@lists.postgresql.org Subject: Re: Remove duplicated row in pg_largeobject_metadata In-reply-to: References: Comments: In-reply-to Tobias Meyer message dated "Sat, 18 Sep 2021 17:35:45 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1488150.1631984508.1@sss.pgh.pa.us> Date: Sat, 18 Sep 2021 13:01:48 -0400 Message-ID: <1488151.1631984508@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tobias Meyer writes: > Now I see > select oid,* from pg_largeobject_metadata where oid=665238; > oid | lomowner | lomacl > --------+----------+-------- > 665238 | 16123 | > 665238 | 16123 | > (2 rows) hmm ... is this a reasonably up-to-date v10? > Deleting both would be a no-go, as I cannot INSERT a specific oid to add > one back as far as I know. > So how do I delete only one of the two? Delete by ctid. select ctid, oid, * from pg_largeobject_metadata where oid=665238; delete from pg_largeobject_metadata where ctid = 'pick one'; regards, tom lane