May 17, 2026, 11:40 PM
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
• A schema is a named collection of tables. A schema can also contain views, indexes, sequences, data types, operators, and functions.
|
||||
|
||||
--- Create schema:
|
||||
|
||||
postgres=# create schema dba_schema;
|
||||
CREATE SCHEMA
|
||||
|
||||
-- Create schema with authorize particular user:
|
||||
|
||||
postgres=# create schema dba_schema authorization raj2;
|
||||
CREATE SCHEMA
|
||||
|
||||
-- Drop schema
|
||||
|
||||
postgres=# drop schema dba_schema;
|
||||
DROP SCHEMA
|
||||
|
||||
-- List down schemas present
|
||||
|
||||
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)
|
||||
Reference in New Issue
Block a user