postgres=# \d pg_database
Table "pg_catalog.pg_database"
Column | Type | Collation | Nullable | Default
---------------+-----------+-----------+----------+---------
oid | oid | | not null |
datname | name | | not null |
datdba | oid | | not null |
encoding | integer | | not null |
datcollate | name | | not null |
datctype | name | | not null |
datistemplate | boolean | | not null |
datallowconn | boolean | | not null |
datconnlimit | integer | | not null |
datlastsysoid | oid | | not null |
datfrozenxid | xid | | not null |
datminmxid | xid | | not null |
dattablespace | oid | | not null |
datacl | aclitem[] | | |
Indexes:
"pg_database_oid_index" PRIMARY KEY, btree (oid), tablespace "pg_global"
"pg_database_datname_index" UNIQUE CONSTRAINT, btree (datname), tablespace "pg_global"
Tablespace: "pg_global"
postgres=# \d pg_user;
View "pg_catalog.pg_user"
Column | Type | Collation | Nullable | Default
--------------+--------------------------+-----------+----------+---------
usename | name | | |
usesysid | oid | | |
usecreatedb | boolean | | |
usesuper | boolean | | |
userepl | boolean | | |
usebypassrls | boolean | | |
passwd | text | | |
valuntil | timestamp with time zone | | |
useconfig | text[] | C | |
CREATE DATABASE dbname TEMPLATE template0;
CREATE SCHEMA sampleSchema;
CREATE TABLE sampleSchema.maTable ( colname type );
CREATE TABLE maTable( col type);
-- équivalent à CREATE TABLE public.maTable( col type);
REVOKE ALL ON DATABASE newDatabase FROM PUBLIC;
GRANT ALL ON DATABASE newDatabase TO newDatabaseOwner;
REVOKE CREATE ON SCHEMA public FROM PUBLIC;