mirror of
https://github.com/chubin/cheat.sheets
synced 2024-11-01 21:40:24 +00:00
11 lines
240 B
Plaintext
11 lines
240 B
Plaintext
-- List schemas
|
|
\dn
|
|
SELECT schema_name FROM information_schema.schemata;
|
|
SELECT nspname FROM pg_catalog.pg_namespace;
|
|
|
|
-- Create schema
|
|
CREATE SCHEMA IF NOT EXISTS <schema_name>;
|
|
|
|
-- Drop schema
|
|
DROP SCHEMA IF EXISTS <schema_name> CASCADE;
|