Re: Problem with function-arguments - Mailing list pgsql-admin

From Hans Peter Ertz
Subject Re: Problem with function-arguments
Date
Msg-id 49F24870.1020807@gmx.net
Whole thread Raw
In response to Problem with function-arguments  (Hans Peter Ertz <hansi_mailinglisten@gmx.net>)
List pgsql-admin
Hello again!

Problem solved!

I switched my language to plpgsql and used the execute-command. The
function now looks like:

CREATE OR REPLACE FUNCTION sys.create_user(character varying, character
varying)
   RETURNS void AS
$BODY$
BEGIN
    execute 'CREATE USER ' || quote_ident($1) || ' PASSWORD ' ||
quote_literal($2) || ' NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE';
END;
$BODY$
   LANGUAGE 'plpgsql' VOLATILE SECURITY DEFINER;

Nevertheless - thanks for thinking ;-),
Hans Peter Ertz

pgsql-admin by date:

Previous
From: Hans Peter Ertz
Date:
Subject: Problem with function-arguments
Next
From: Dot Yet
Date:
Subject: Re: How to map columns in pg_stat_activity to windows PID