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

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;