Issue with GRANT/COMMENT ON FUNCTION with default

From: Jim Nasby <jim(at)nasby(dot)net>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Issue with GRANT/COMMENT ON FUNCTION with default
Date: 2014-05-05 20:09:35
Message-ID: 5367EFFF.8070703@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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? 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.
--
Jim C. Nasby, Data Architect jim(at)nasby(dot)net
512.569.9461 (cell) http://jim.nasby.net

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2014-05-05 20:13:45 Re: 9.4 release notes
Previous Message Andres Freund 2014-05-05 20:05:01 Re: Recursive ReceiveSharedInvalidMessages not safe