CREATE OR REPLACE FUNCTION create_user text text RETURNS integer AS BO

1
2
3
4
5
6
7
8
9
CREATE OR REPLACE FUNCTION create_user(text, text)
RETURNS integer AS
$BODY$
begin
create role $1 with login password $2;
return 1;
end;
$BODY$
LANGUAGE 'plpgsql'