Q:

Create a schema with the name passed by variable

I want to create a schema with with a name passed by variable.
Example:
CREATE OR REPLACE FUNCTION test1("name" character varying)
  RETURNS void AS
'CREATE SCHEMA "name";'
  LANGUAGE 'sql' VOLATILE
  COST 100;

A:

You could use plpgsql and than EXECUTE:
CREATE OR REPLACE FUNCTION test1("name" character varying)
RETURNS void AS
$$
BEGIN
    EXECUTE 'CREATE SCHEMA '|| quote_ident($1); -- security

    RETURN;
END;
$$
LANGUAGE plpgsql
VOLATILE
COST 20;

