DBA Hub

📋Steps in this guide1/1

Create/Drop schema in postgres

• A schema is a named collection of tables. A schema can also contain views, indexes, sequences, data types, operators, and functions.

postgresql configurationintermediate
by PostgreSQL
14 views
1

Create/Drop schema in postgres

--- Create schema: -- Create schema with authorize particular user: -- Drop schema -- List down schemas present

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
• A schema is a named collection of tables. A schema can also contain views, indexes, sequences, data types, operators, and functions.
postgres=#
create schema dba_schema;
CREATE SCHEMA
postgres=#
create schema dba_schema authorization raj2;
CREATE SCHEMA
postgres=#
drop schema dba_schema;
DROP SCHEMA
postgres=#
\dn+
List of schemas
Name        | Owner.   | Access privileges    | Description
------------+----------+----------------------+------------------------
dba_schema | raj2      |                      |
public     | postgres  | postgres=UC/postgres+| standard public schema
| | =UC/postgres |
raj.       | postgres | |
(3 rows)

Comments (0)

Please to add comments

No comments yet. Be the first to comment!