CDB-3302 CDB_CheckQuota now also accepts a schema name. Added a convenience method to check if a schema is valid or not

This commit is contained in:
Kartones
2014-07-04 11:48:53 +02:00
parent 021d922d84
commit 3d595976f6
2 changed files with 35 additions and 8 deletions

View File

@@ -11,3 +11,10 @@ BEGIN
EXECUTE sql;
END;
$$ language 'plpgsql' VOLATILE;
CREATE OR REPLACE FUNCTION cartodb.schema_exists(schema_name text)
RETURNS boolean AS
$$
SELECT EXISTS(SELECT 1 FROM pg_namespace WHERE nspname = schema_name);
$$
language sql VOLATILE;