2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-01 21:40:24 +00:00
cheat.sheets/sheets/_psql/schema

11 lines
240 B
Plaintext
Raw Normal View History

2018-01-17 16:13:38 +00:00
-- List schemas
2018-01-07 11:42:08 +00:00
\dn
SELECT schema_name FROM information_schema.schemata;
SELECT nspname FROM pg_catalog.pg_namespace;
2018-01-17 16:13:38 +00:00
-- Create schema
2018-01-07 11:42:08 +00:00
CREATE SCHEMA IF NOT EXISTS <schema_name>;
2018-01-17 16:13:38 +00:00
-- Drop schema
2018-01-07 11:42:08 +00:00
DROP SCHEMA IF EXISTS <schema_name> CASCADE;