Re: Bug in pg_describe_object, patch v2 - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: Bug in pg_describe_object, patch v2
Date
Msg-id m2ei8b6xy6.fsf@2ndQuadrant.fr
Whole thread Raw
In response to Re: Bug in pg_describe_object, patch v2  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Joel Jacobson <joel@gluefinance.com> writes:
>> a) pg_describe_object should always include the schema in the name,
>> even for object in public and pg_catalog.
>
> I knew you were going to demand that next, as soon as you figured out
> that it was an obstacle for using pg_describe_object output as a
> globally unique identifier.  But I'm going to reply, once again, that
> pg_describe_object is not meant to guarantee that and we're not going to
> make it so.

And it's easy to pretend it's already coded this way if you're motivated
enough.  Just find a schema name that's not already existing:

dim=# set search_path to public, utils;
SET
dim=# select pg_describe_object('pg_proc'::regclass, 16602, 0);                     pg_describe_object
    
 
---------------------------------------------------------------function
unaccent_lexize(internal,internal,internal,internal)
(1 row)

dim=# begin; create schema dummy; set local search_path to 'dummy'; select pg_describe_object('pg_proc'::regclass,
16602,0); rollback;
 
BEGIN
CREATE SCHEMA
SET                        pg_describe_object                          
---------------------------------------------------------------------function
utils.unaccent_lexize(internal,internal,internal,internal)
(1 row)

ROLLBACK

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


pgsql-hackers by date:

Previous
From: Andreas Karlsson
Date:
Subject: Re: Bug in pg_describe_object, patch v2
Next
From: Tom Lane
Date:
Subject: Re: We need to log aborted autovacuums