Difference between revisions of "List schemas: \dn"
Jump to navigation
Jump to search
(18 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | + | Default [[Schema]]s in PostgreSQL Ubuntu | |
− | + | \dn | |
List of schemas | List of schemas | ||
Name | Owner | Name | Owner | ||
--------+---------- | --------+---------- | ||
− | public | postgres | + | [[public]] | [[postgres]] |
(1 row) | (1 row) | ||
+ | |||
+ | select nspname [[as schema]], usename as owner from pg_namespace, pg_user where pg_namespace.nspowner = pg_user.usesysid and pg_user.usename ='YOUR_USERNAME'; | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | \dn+ | ||
+ | List of schemas | ||
+ | Name | Owner | Access privileges | Description | ||
+ | --------+----------+----------------------+------------------------ | ||
+ | public | postgres | postgres=UC/postgres+| standard public schema | ||
+ | | | =UC/postgres | | ||
+ | (1 row) | ||
+ | |||
+ | |||
+ | \dn | ||
List of schemas | List of schemas | ||
Name | Owner | Name | Owner | ||
Line 19: | Line 35: | ||
(6 rows) | (6 rows) | ||
+ | == Related == | ||
+ | * <code>[[SELECT version();]]</code> | ||
+ | * <code>[[CREATE SCHEMA]]</code> | ||
+ | * <code>[[GRANT]]</code>, <code>[[GRANT ALL]]</code>, <code>[[GRANT USAGE]]</code> | ||
== See also == | == See also == | ||
+ | * {{Schema}} | ||
* {{psql}} | * {{psql}} | ||
[[Category: PostgreSQL]] | [[Category: PostgreSQL]] | ||
[[Category: SQL]] | [[Category: SQL]] |
Latest revision as of 12:07, 11 May 2023
Default Schemas in PostgreSQL Ubuntu
\dn List of schemas Name | Owner --------+---------- public | postgres (1 row)
select nspname as schema, usename as owner from pg_namespace, pg_user where pg_namespace.nspowner = pg_user.usesysid and pg_user.usename ='YOUR_USERNAME';
\dn+ List of schemas Name | Owner | Access privileges | Description --------+----------+----------------------+------------------------ public | postgres | postgres=UC/postgres+| standard public schema | | =UC/postgres | (1 row)
\dn List of schemas Name | Owner -------------+------------------- your_schema1 | your_username your_schema1 | your_username your_schema1 | your_username2 your_schema1 | rds_master public | rds_master raw | rds_master (6 rows)
Related[edit]
See also[edit]
- Schema,
search_path, \dn+, GRANT ALL PRIVILEGES ON SCHEMA
- PostgreSQL:
psql
,.psqlrc, .pgpass
,$HOME/.pg service.conf
,-U, -W, -d
, meta-commands:\du, \dg, \ddp, \dp, \list, \dn, \dt, \c, \l, \di, \q
,show users
,show
,su - postgres
,psql -c, \?, \connect, \conninfo
,--version, --help
, PL/pgSQL
Advertising: