Re: patch: Allow \dd to show constraint comments - Mailing list pgsql-hackers

From Robert Haas
Subject Re: patch: Allow \dd to show constraint comments
Date
Msg-id BANLkTinT3pNhVJB3KBCq+vQAYmLqgU-j8A@mail.gmail.com
Whole thread Raw
In response to Re: patch: Allow \dd to show constraint comments  (Josh Kupershmidt <schmiddy@gmail.com>)
List pgsql-hackers
On Sat, Jun 18, 2011 at 1:43 PM, Josh Kupershmidt <schmiddy@gmail.com> wrote:
>> Regarding to the data-type of objnamespace, how about an idea to define a new
>> data type such as 'regschema' and cast objnamespace into this type?
>> If we have such data type, user can reference string expression of schema name,
>> and also available to use OID joins.
>
> Are you suggesting we leave the structure of pg_comments unchanged,
> but introduce a new 'regschema' type so that if users want to easily
> display the schema name of an object, they can just do:
>
>  SELECT objnamespace::regschema, ...
>    FROM pg_comments WHERE ... ;
>
> That seems reasonable to me.

In the past I think the feeling has been that reg* types are primarily
useful for objects with schema-qualified names.  Translating a table
OID into a table name is actually sort of non-trivial, at least if you
want to schema-qualify its name when and only when necessary.  The use
case seems quite a bit weaker for schemas, since you can easily pull
the right value from pg_namespace with a subquery if you are so
inclined.

It is perhaps worth noting that the patch now under discussion on this
thread does something quite a lot different than what the subject
would suggest.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: crash-safe visibility map, take five
Next
From: Noah Misch
Date:
Subject: Re: Identifying no-op length coercions