Seamus Thomas Carroll <carrolls(at)cpsc(dot)ucalgary(dot)ca> writes:
> Is there any possible way to create a schema without having
> to hard code the name?
Not in CREATE SCHEMA itself. But you could use a plpgsql or pltcl
function to construct the needed command as a string, and execute
that. In plpgsql it'd look something like
DECLARE newschema text;
...
SELECT INTO newschema agent_schema FROM ... WHERE ...;
EXECUTE "CREATE SCHEMA " || quote_ident(newschema);
...
The same goes for other utility commands (which is to say everything
except SELECT/INSERT/UPDATE/DELETE).
regards, tom lane