plpgsql cant to set role from function. is bug? - Mailing list pgsql-hackers

From Pavel Stehule
Subject plpgsql cant to set role from function. is bug?
Date
Msg-id BAY20-F75E126F7E8522C34962D4F9B20@phx.gbl
Whole thread Raw
List pgsql-hackers
Hello

This code run without error, but do nothing

drop role x;
create role x;
create or replace function foo() returns void as $$
begin grant root to x;
end;
$$ language plpgsql;
\dg x
revoke root from x;

postgres=# postgres=# DROP ROLE
postgres=# CREATE ROLE
postgres=# postgres$# postgres$# postgres$# postgres$# CREATE FUNCTION
postgres=#                                List of roles
Role name | Superuser | Create role | Create DB | Connections | Member of
-----------+-----------+-------------+-----------+-------------+-----------
x         | no        | no          | no        | no limit    |
(1 row)

postgres=# WARNING:  role "x" is not a member of role "root"
REVOKE ROLE
postgres=#

what is wrong?
Regards
Pavel Stehule

p.s. root is postgresql superuser

_________________________________________________________________
Chcete sdilet sve obrazky a hudbu s prateli? http://messenger.msn.cz/



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Constraint Exclusion + Joins?
Next
From: "Pavel Stehule"
Date:
Subject: plpgsql cant to set role from function. is bug?, SOLVED