[Pkg-postgresql-public] Bug#769848: Bug#769848: [postgresql-contrib-9.4] uuid-ossp strange parms

Christoph Berg myon at debian.org
Mon Nov 17 13:56:13 UTC 2014


Control: tags -1 moreinfo

Re: Bzzzz 2014-11-17 <20141117021045.1879e687 at msi.defcon1>
> There are 2 Fn that pose a problem in this extension:
>    uuid_generate_v3(namespace uuid, name text)
>    uuid_generate_v5(namespace uuid, name text)
> because pg_get_function_identity_arguments(func_oid)
> and pg_get_function_arguments(func_oid) always return:
> "namespace uuid, name text" as parameters instead of
> "uuid, text".
> 
> This prevents to reconstitute these Fn full names in
> an external python program (in order to grant or revoke
> user rights.)

Hi,

I don't think that's a bug. While it's uncommon for builtin functions
to have named arguments, there's a few others in pg_catalog.

Also, GRANT/REVOKE works with named parameters as well:

CREATE FUNCTION exec(text) RETURNS text LANGUAGE plpgsql VOLATILE AS
$f$BEGIN EXECUTE $1; RETURN $1; END;$f$;

select exec(format('grant all on function %I(%s) to public', proname, pg_get_function_arguments(oid))) from pg_proc where proname ~ 'uuid';
                                    exec                                     
-----------------------------------------------------------------------------
[...]
 grant all on function uuid_generate_v3(namespace uuid, name text) to public
 grant all on function uuid_generate_v4() to public
 grant all on function uuid_generate_v5(namespace uuid, name text) to public
(22 Zeilen)

What issue specifically do you have with this?

Christoph
-- 
cb at df7cb.de | http://www.df7cb.de/



More information about the Pkg-postgresql-public mailing list