Search Postgresql Archives

Unexpected message in grant/revoke script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I have the following function:

create function new_student (text) returns text as $$
        declare
                wtf integer := 1;
        begin
        execute 'create schema ' || $1;
        execute 'create role ' || $1 || 'LOGIN';
        execute 'revoke all on schema public from ' || $1;
        execute 'grant select on schema public to ' || $1;
        execute 'grant all on schema ' || $1 || ' to ' || $1 || '
with grant option';
        return $1;
end;
$$ language plpgsql
;

When I run this with select new_student('foobar'), I get the following
error message

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux