Hi Khine,
Welcome to the forums!
To create a schema in a Vertica database you must be logged in as a user having the superuser or CREATE privilege for the database.
You use the CREATE SCHEMA command to create a schema:
Code: Select all
dbadmin=> CREATE SCHEMA my_schema;
CREATE SCHEMA
You can use the \dn vsql meta command to view info about a schema:
Code: Select all
dbadmin=> \dn my_schema;
List of schemas
Name | Owner | Comment
-----------+---------+---------
my_schema | dbadmin |
(1 row)
Notice that by default, the owner of the schema is the creator.
If you want another user to own the schema, use the AUTHORIZATION key word in the create statement.
Example:
Code: Select all
dbadmin=> CREATE USER jim;
CREATE USER
dbadmin=> CREATE SCHEMA jim_schema AUTHORIZATION jim;
CREATE SCHEMA
dbadmin=> \dn jim_schema
List of schemas
Name | Owner | Comment
------------+-------+---------
jim_schema | jim |
(1 row)
I hope this helps!