[BUG] pg_identify_object_as_address() returns duplicate values - Mailing list pgsql-bugs

From Joel Jacobson
Subject [BUG] pg_identify_object_as_address() returns duplicate values
Date
Msg-id f94aaa11-19b0-4b99-a5cf-3e0b49bbe5dd@www.fastmail.com
Whole thread Raw
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: Neil Chen
Date:
Subject: Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES
Next
From: Alexey Bashtanov
Date:
Subject: should all not-null constraints be inherited?