Thread: [BUG] pg_identify_object_as_address() returns duplicate values
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