User and Schema Creation in Greenplum Database

User and Schema Creation in Greenplum Database

Purpose of the Document

Procedure for Creation of User / Database (Schema) on any DB versions of Greenplum.

Procedure

================================================================     

Create User Accounts

================================================================    

Use the following procedure to create user account.

(i)Login in to the server as a toot user

(ii) switch in to gpadmin user

(iii) Run the command :  psql postgres

(iv) Run below command for creating the user

create user <username> with password ‘<password>’;

================================================================

GRANT Access privileges for User Accounts

================================================================     

Use the following procedure to give access privileges.

(i) Login in to the server as a toot user

(ii) switch in to gpadmin user

(iii) Run the command :  psql postgres

(iv) Run below command for creating the user

GRANT ALL PRIVILEGES ON  DATABASE <DatabaseName>  TO < Username>;

================================================================    

Create Database / Schema Accounts

===============================================================

CREATE SCHEMA enters a new schema into the current database. The schema name must be distinct from the name of any existing schema in the current database.

A schema is essentially a namespace: it contains named objects (tables, data types, functions, and operators) whose names may duplicate those of other objects existing in other schemas. Named objects are accessed either by qualifying their names with the schema name as a prefix, or by setting a search path that includes the desired schema(s). A CREATE command specifying an unqualified object name creates the object in the current schema (the one at the front of the search path, which can be determined with the function current_schema).

To create a database, type the following command:

CREATE SCHEMA <DatabaseName>;

Leave a Reply