Re: patch: Allow \dd to show constraint comments
От | Josh Kupershmidt |
---|---|
Тема | Re: patch: Allow \dd to show constraint comments |
Дата | |
Msg-id | BANLkTinjA+wKmKzyDVqPQ7j2dVeY0Miy6w@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: patch: Allow \dd to show constraint comments (Kohei KaiGai <kaigai@kaigai.gr.jp>) |
Ответы |
Re: patch: Allow \dd to show constraint comments
Re: patch: Allow \dd to show constraint comments |
Список | pgsql-hackers |
On Sat, Jun 18, 2011 at 10:53 AM, Kohei KaiGai <kaigai@kaigai.gr.jp> wrote: > At first, I noticed three missing object classes although COMMENT ON allows to > set a description on 'collation', 'extension' and 'foreign table'. Good catch. Attached patch adds these types in. > In addition, this pg_comments system view supports 'access method' class, but > we cannot set a comment on access methods using COMMENT ON statement. Well, there are comments for the built-in access methods, i.e. test=# select * from pg_comments WHERE objtype = 'access method'; objoid | classoid | objsubid | objtype | objnamespace | objname | description --------+----------+----------+---------------+--------------+---------+---------------------------- 403 | 2601 | 0 | access method | | btree | b-tree index access method 405 | 2601 | 0 | access method | | hash | hash index access method 783 | 2601 | 0 | access method | | gist | GiST index access method 2742 | 2601 | 0 | access method | | gin | GIN index access method (4 rows) So I think it's useful to leave objtype = 'access method' in pg_comments. I guess the assumption is that the only time you would need to tweak a comment on an access method is if you're building your own, and if so you can enter the comment into the catalogs manually. > 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. Josh
Вложения
В списке pgsql-hackers по дате отправления: