Re: How about to have relnamespace and relrole?

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: How about to have relnamespace and relrole?
Дата
Msg-id 551AFB0D.2070000@dunslane.net
обсуждение исходный текст
Ответ на Re: How about to have relnamespace and relrole?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: How about to have relnamespace and relrole?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 03/29/2015 02:55 PM, Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>> I have just claimed this as committer in the CF, but on reviewing the
>> emails it looks like there is disagreement about the need for it at all,
>> especially from Tom and Robert.
>> I confess I have often wanted regnamespace, particularly, and
>> occasionally regrole, simply as a convenience. But I'm not going to
>> commit it against substantial opposition.
>> Do we need a vote?
> My concern about it is basically that I don't see where we stop.
> The existing regFOO alias types are provided for object classes which
> have nontrivial naming conventions (schema qualification, overloaded
> argument types, etc), so that you can't just do "select ... from
> catalog where objectname = 'blah'".  That doesn't apply to namespaces
> or roles.  So I'm afraid that once this precedent is established,
> there will be demands for regFOO for every object class we have,
> and I don't want that much clutter.
>
> It may be that these two cases are so much more useful than any other
> conceivable cases that we can do them and stop, but I don't think that
> argument has been made convincingly.


Well, here's a list of all the fooname attributes in the catalog, which 
I guess are the prime candidates for regfoo pseudotypes. Besides those 
we already have and the two proposed here, I'm not sure there will be 
huge demand for others - tablespace maybe, trigger doesn't seem very 
practicable, and I could just see suggestions for collation and 
conversion, but those seem pretty marginal, and that seems to be about 
it, to me.
                      attrelid                  | attname
--------------------------------------------+--------------------------    pg_proc                                    |
proname    pg_type                                    | typname     pg_attribute                               |
attname    pg_class                                   | relname     pg_constraint                              |
conname    pg_operator                                | oprname     pg_opfamily                                |
opfname    pg_opclass                                 | opcname     pg_am                                      | amname
   pg_language                                | lanname     pg_rewrite                                 | rulename
pg_trigger                                | tgname     pg_event_trigger                           | evtname
pg_namespace                              | nspname     pg_conversion                              | conname
pg_database                               | datname     pg_tablespace                              | spcname
pg_pltemplate                             | tmplname     pg_authid                                  | rolname
pg_ts_config                              | cfgname     pg_ts_dict                                 | dictname
pg_ts_parser                              | prsname     pg_ts_template                             | tmplname
pg_extension                              | extname     pg_foreign_data_wrapper                    | fdwname
pg_foreign_server                         | srvname     pg_policy                                  | polname
pg_collation                              | collname
 


cheers

andrew




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: clang -fsanitize=undefined error in ecpg
Следующее
От: Andreas Karlsson
Дата:
Сообщение: Move inet_gist to right place in pg_amproc