[Fwd: Re: [HACKERS] obj_description problems?]

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: [Fwd: Re: [HACKERS] obj_description problems?]
Date: 2003-10-21 05:44:55
Message-ID: 3F94C7D7.3030102@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Doh - this should have been sent to -patches in the first place...

Chris

-------- Original Message --------
Subject: Re: [HACKERS] obj_description problems?
Date: Tue, 21 Oct 2003 13:42:16 +0800
From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
CC: Hackers <pgsql-hackers(at)postgresql(dot)org>
References: <3F94C239(dot)3070601(at)familyhealth(dot)com(dot)au>

Ooer - it is a nasty bug. From pg_proc.h, the definition of
obj_description is:

select description from pg_description where objoid = $1 and classoid =
(select oid from pg_class where relname = $2 and relnamespace = PGNSP)
and objsubid = 0

And what's more, none of the SQL functions in pg_proc.h are properly
qualified. I have attached a patch that may or may not be the solution
- please check.

I didn't know how to handle 'timestamp without time zone' types and
'overlaps'.

I realise now that there's no need to schema-qualify names - you can
only do names from pg_catalog.

Chris

Christopher Kings-Lynne wrote:

> How do I use a schema-qualified name in obj_description? Or is this a
> nsty little bug?
>
> Chris
>
> test2=# create schema myschema;
> CREATE SCHEMA
> test2=# create table myschema.pg_class (a int4);
> CREATE TABLE
> test2=# select oid from pg_catalog.pg_class where
> oid='myschema.pg_class'::regclass;
> oid
> ---------
> 1475161
> (1 row)
>
> test2=# select obj_description('1475161', 'pg_class');
> obj_description
> -----------------
>
> (1 row)
>
> test2=# select obj_description('1475161', 'pg_catalog.pg_class');
> obj_description
> -----------------
>
> (1 row)
>
> test2=# set search_path to myschema, pg_catalog;
> SET
> test2=# select obj_description('1475161', 'pg_class');
> ERROR: Attribute "relname" not found
> test2=# select obj_description('1475161', 'pg_catalog.pg_class');
> ERROR: Attribute "relname" not found
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

Attachment Content-Type Size
pg_proc.txt text/plain 17.8 KB

Browse pgsql-patches by date

  From Date Subject
Next Message Christopher Kings-Lynne 2003-10-21 05:51:28 Re: [HACKERS] obj_description problems?
Previous Message Christopher Kings-Lynne 2003-10-21 05:42:16 Re: obj_description problems?