Re: Issue with GRANT/COMMENT ON FUNCTION with default

Поиск
Список
Период
Сортировка
Искать
От
Alvaro Herrera
Тема
Re: Issue with GRANT/COMMENT ON FUNCTION with default
Дата
в 20:22:56
Msg-id
20140505202250.GO6018@eldon.alvh.no-ip.org
Ответ на
Список
Дерево обсуждения
Issue with GRANT/COMMENT ON FUNCTION with default Jim Nasby <jim@nasby.net>
Re: Issue with GRANT/COMMENT ON FUNCTION with default Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Issue with GRANT/COMMENT ON FUNCTION with default Jim Nasby <jim@nasby.net>
Re: Issue with GRANT/COMMENT ON FUNCTION with default Peter Eisentraut <peter_e@gmx.net>
Re: Issue with GRANT/COMMENT ON FUNCTION with default Jim Nasby <jim@nasby.net>
Re: Issue with GRANT/COMMENT ON FUNCTION with default Tom Lane <tgl@sss.pgh.pa.us>
Jim Nasby wrote:
> Prior to default parameters on functions, GRANT and COMMENT accepted full parameter syntax. IE:
> 
> GRANT EXECUTE ON test(t text) TO public
> 
> as opposed to regprocedure, which only accepts the data types ( test(text), not test(t text) ).
> 
> They do not accept DEFAULT though:
> 
> GRANT EXECUTE ON FUNCTION test(t text DEFAULT '') to public;
> ERROR:  syntax error at or near "DEFAULT"
> LINE 1: GRANT EXECUTE ON FUNCTION test(t text DEFAULT '') to public;
> 
> Presumably this is just an oversight?

I have to say that accepting DEFAULT there seems pretty odd to me.  What
if you specify the wrong default?  Do you get a "no such function"
error?  That would be pretty unhelpful.  But then accepting it ignoring
the fact that the default is wrong would be rather strange.

> Related to that, is it intentional that the regprocedure cast
> disallows *any* decorators to the function, other than type? If
> regprocedure at least accepted the full function parameter definition
> you could use it to get a definitive reference to a function.

Does pg_identify_object() give you what you want?

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


В списке pgsql-hackers по дате отправления
От: Peter Geoghegan
Дата:
Сообщение: Re: 9.4 release notes
От: Bruce Momjian
Дата:
Сообщение: Re: 9.4 release notes
FAQ