Bug in pg_describe_object (was: Re: [HACKERS] obj_unique_identifier(oid))

From: Andreas Karlsson <andreas(at)proxel(dot)se>
To: Joel Jacobson <joel(at)gluefinance(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, Jim Nasby <jim(at)nasby(dot)net>, Herrera Alvaro <alvherre(at)commandprompt(dot)com>, pgsql-hackers Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Bug in pg_describe_object (was: Re: [HACKERS] obj_unique_identifier(oid))
Date: 2011-01-10 19:38:50
Message-ID: 1294688330.27439.59.camel@jansson
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Here is the bug-fix patch again with a description of the context so I
can add it to the commit fest.

Joel Jacobson discovered a bug in the function pg_describe_object where
it does not produce unique identifiers for some entries in pg_amproc.

This patch fixes the bug where when two entries in pg_amproc only differ
in amproclefttype or amprocrighttype the same description will be
produced by pg_describe_object, by simply adding the two fields
(amproclefttype, amprocrighttype) to the description.

== Before patch

SELECT pg_describe_object('pg_amproc'::regclass,oid,0)
FROM pg_amproc WHERE oid IN (10608,10612);
pg_describe_object
------------------------------------------------------------------------------------
function 1 bttextcmp(text,text) of operator family array_ops for access method gin
function 1 bttextcmp(text,text) of operator family array_ops for access method gin
(2 rows)

== After patch

SELECT pg_describe_object('pg_amproc'::regclass,oid,0)
FROM pg_amproc WHERE oid IN (10608,10612);
pg_describe_object
----------------------------------------------------------------------------------------------------------------------------------
function 1 bttextcmp(text,text) of operator family array_ops for access method gin for (text[],text[])
function 1 bttextcmp(text,text) of operator family array_ops for access method gin for (character varying[],character varying[])
(2 rows)

Regards,
Andreas

Attachment Content-Type Size
fix-amproctypes-in-get-object-description.patch text/x-patch 1.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2011-01-10 19:46:54 walsender parser patch
Previous Message Josh Berkus 2011-01-10 19:29:56 Re: Compatibility GUC for serializable