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 1lRUXF-0004KE-CD for pgsql-bugs@arkaria.postgresql.org; Wed, 31 Mar 2021 06:41:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lRUXE-0004Ck-5N for pgsql-bugs@arkaria.postgresql.org; Wed, 31 Mar 2021 06:41:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRUXD-0004Cd-5Z for pgsql-bugs@lists.postgresql.org; Wed, 31 Mar 2021 06:40:59 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRUXA-00047U-0u for pgsql-bugs@lists.postgresql.org; Wed, 31 Mar 2021 06:40:58 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id E7BE21FBB for ; Wed, 31 Mar 2021 02:40:53 -0400 (EDT) Received: from imap2 ([10.202.2.52]) by compute5.internal (MEProxy); Wed, 31 Mar 2021 02:40:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=compiler.org; h= mime-version:message-id:date:from:to:subject:content-type; s= fm1; bh=AmRcp2eJwNBkYb8NOAFeKvLfYdLf/A4BdF9v5Pe4KDg=; b=H4Iyp/XS 2qyM4dIjt0AFcgJJ6ApRFRZQA4amgrumDswvlEEHb8u4Vneclr3N6smCCK0hrmsT 8wXsf9VGyqjZ+8NwB927tKgq/e9aS85ZuwcJjFole3QkMgSUYPPSB2fAOkVeGzyT vuOUfV+52ugSlAagyO5DtLP498fWbARb0hJiaNn01PUPFhx1Ab3gZ1Tf4ZFNwTMU kkEB9HswiicBQaTAdp8jpQK7G/cuS/O4xlPNJ3imAJQQwGZP2RhXADElZ1m4nTjY Q0GQj6H6J/MBLUXyAFrVJCwlJ9ExNJdR4Pim4ar2wErIGCEBx/dJaUOZPH4umdvs qjlO/ftx2FymOw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=AmRcp2eJwNBkYb8NOAFeKvLfYdLf/ A4BdF9v5Pe4KDg=; b=vqiioChHELwZLWFIPkrM/tgJIn7tiP0PJK1nQXRIXuyOV qG4VlM9HcykBqAdSQ1Xou4PAbj6PPRM5IJuYkURzimqb6fpCaPNx7n0/aK0R8nm1 mi9y+gMmoC6LI1SwhI9lfqljPVr4pdfbYKa2Mrro9cUPt4Y0zjDsie0e8QOzkKMQ iFz9jEjGJBHYuXtFo9vfhL1wLmdKXbBp2Uv7/SF6KjOxxHIfK7HHaDnd2RwAhy+L m+nZY35Y2SnNgpq84SYN7pXdT5x7mBgnhk+KPS2SjObiPVcpkw4NQZl11ITkFvu0 C9BXuSFAF6oTcxFY+FLxGFQNBRChBJyW3Oyfj/ziw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudeiuddguddtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkfffhvffutgesrgdtre erreertdenucfhrhhomhepfdflohgvlhculfgrtghosghsohhnfdcuoehjohgvlhestgho mhhpihhlvghrrdhorhhgqeenucggtffrrghtthgvrhhnpeeggfdvhffgfeejtdelgeetje ejhfeigeejvdfhheeuteefkedtieeifeehffekleenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpehjohgvlhestghomhhpihhlvghrrdhorhhg X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id B3456A00073; Wed, 31 Mar 2021 02:40:52 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-273-g8500d2492d-fm-20210323.002-g8500d249 Mime-Version: 1.0 Message-Id: Date: Wed, 31 Mar 2021 08:40:32 +0200 From: "Joel Jacobson" To: pgsql-bugs@lists.postgresql.org Subject: [BUG] pg_identify_object_as_address() returns duplicate values Content-Type: multipart/alternative; boundary=9b9c6758a0234f1f855785e68a4b59d9 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --9b9c6758a0234f1f855785e68a4b59d9 Content-Type: text/plain Hi, The documentation for this function says "Returns a row containing enough information to uniquely identify the database object specified by catalog OID, object OID and sub-object ID" However, this contract is broken for some pg_collation.oid values. The problem is "collencoding" is not included in the data returned by pg_identify_object_as_address(), but "collencoding" *is* included in the UNIQUE UNIQUE CONSTRAINT: (collname, collencoding, collnamespace). Example: SELECT pg_identify_object_as_address('pg_collation'::regclass,oid,0), * FROM pg_collation WHERE collname = 'en_GB'; pg_identify_object_as_address | oid | collname | collnamespace | collowner | collprovider | collisdeterministic | collencoding | collcollate | collctype -------------------------------------+-------+----------+---------------+-----------+--------------+---------------------+--------------+------------------+------------------ (collation,"{pg_catalog,en_GB}",{}) | 13662 | en_GB | 11 | 10 | c | t | 6 | en_GB | en_GB (collation,"{pg_catalog,en_GB}",{}) | 13754 | en_GB | 11 | 10 | c | t | 8 | en_GB.ISO8859-1 | en_GB.ISO8859-1 (collation,"{pg_catalog,en_GB}",{}) | 13755 | en_GB | 11 | 10 | c | t | 16 | en_GB.ISO8859-15 | en_GB.ISO8859-15 (3 rows) /Joel --9b9c6758a0234f1f855785e68a4b59d9 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
Hi,

The documentation for this function says

"Returns a row containing enough information to uni= quely identify the database object specified by catalog OID, object OID = and sub-object ID"

However, this contract i= s broken for some pg_collation.oid values.

=
The problem is "collencoding" is not included in the data returned = by pg_identify_object_as_address(),
but "collencoding= " *is* included in the UNIQUE UNIQUE CONSTRAINT: (collname, collenc= oding, collnamespace).

Example:

SELECT pg_identify_object_as_address('pg_collation'::r= egclass,oid,0), * FROM pg_collation WHERE collname =3D 'en_GB';
    pg_identify_object_as_address   = |  oid  | collname | collnamespace | collowner | collprovider= | collisdeterministic | collencoding |   collcollate &nb= sp;  |    collctype
------------------= -------------------+-------+----------+---------------+-----------+-----= ---------+---------------------+--------------+------------------+------= ------------
(collation,"{pg_catalog,en_GB}",{}) | 13662 |= en_GB    |       &nbs= p;    11 |        10 |= c            | t=             =        |     &nbs= p;      6 | en_GB     =        | en_GB
(collation,"{= pg_catalog,en_GB}",{}) | 13754 | en_GB    |  &n= bsp;         11 |  &nb= sp;     10 | c      &n= bsp;     | t      &nbs= p;            |&n= bsp;           8 | en_= GB.ISO8859-1  | en_GB.ISO8859-1
(collation,"{pg_catal= og,en_GB}",{}) | 13755 | en_GB    |   &nbs= p;        11 |    = ;    10 | c       &nbs= p;    | t        =            | &nbs= p;         16 | en_GB.ISO8859-15= | en_GB.ISO8859-15
(3 rows)

= /Joel
--9b9c6758a0234f1f855785e68a4b59d9--