-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
> I [need to] to create schema with arbitrary name but it seems CREATE SCHEMA
> doesn't accept anythig different from a constant as an argument.
The CREATE SCHEMA command needs to be passed a literal string;
one way around this problem is to use a function:
CREATE OR REPLACE FUNCTION createschema(TEXT) RETURNS VOID AS '
BEGIN
EXECUTE \'CREATE SCHEMA \' || quote_ident($1);
RETURN;
END;
' LANGUAGE plpgsql STABLE RETURNS NULL ON NULL INPUT;
- --
Greg Sabino Mullane greg(at)turnstep(dot)com
PGP Key: 0x14964AC8 200311291203
-----BEGIN PGP SIGNATURE-----
iD8DBQE/yNnbvJuQZxSWSsgRAhu1AJ0eqZdsCJuIyZqzpYnJg1rIwetxbQCgwy0h
BqUz0q5cvztSJ4NkuUGysdg=
=UMR0
-----END PGP SIGNATURE-----