Re: patch: Allow \dd to show constraint comments

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
Cc: Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: patch: Allow \dd to show constraint comments
Date: 2011-06-19 03:05:14
Message-ID: BANLkTinT3pNhVJB3KBCq+vQAYmLqgU-j8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jun 18, 2011 at 1:43 PM, Josh Kupershmidt <schmiddy(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2011-06-19 03:06:25 Re: Identifying no-op length coercions
Previous Message Robert Haas 2011-06-19 03:02:01 Re: crash-safe visibility map, take five