Re: patch: Allow \dd to show constraint comments

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: patch: Allow \dd to show constraint comments
Дата
Msg-id BANLkTinT3pNhVJB3KBCq+vQAYmLqgU-j8A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: patch: Allow \dd to show constraint comments  (Josh Kupershmidt <schmiddy@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: crash-safe visibility map, take five
Следующее
От: Noah Misch
Дата:
Сообщение: Re: Identifying no-op length coercions