DM
Size: a a a
DM
A
DM
A
DM
A
\dt+
Schema | Name | Type | Owner | Size | Description
--------+-----------------------------------+-------+---------+------------+----------------------------------------------------
public | ab_test_participations | table | user | 8192 bytes |
public | ab_tests | table | user | 8192 bytes |
public | accounts | table | user | 19 MB |
public | accrual_types | table | user | 48 kB |
public | accruals | table | user | 464 kB |
...
DM
\dt+
Schema | Name | Type | Owner | Size | Description
--------+-----------------------------------+-------+---------+------------+----------------------------------------------------
public | ab_test_participations | table | user | 8192 bytes |
public | ab_tests | table | user | 8192 bytes |
public | accounts | table | user | 19 MB |
public | accrual_types | table | user | 48 kB |
public | accruals | table | user | 464 kB |
...
DM
A
\dn+
List of schemas
Name | Owner | Access privileges | Description
-----------+----------+---------------------------+------------------------
olap | postgres | postgres=UC/postgres +|
| | olap=U/postgres |
DM
\dn+
List of schemas
Name | Owner | Access privileges | Description
-----------+----------+---------------------------+------------------------
olap | postgres | postgres=UC/postgres +|
| | olap=U/postgres |
A
\dnS+
List of schemas
Name | Owner | Access privileges | Description
--------------------+----------+---------------------------+----------------------------------
information_schema | postgres | postgres=UC/postgres +|
| | =U/postgres |
olap | postgres | postgres=UC/postgres +|
| | olap=U/postgres |
pg_catalog | postgres | postgres=UC/postgres +| system catalog schema
| | =U/postgres |
pg_temp_1 | postgres | |
pg_toast | postgres | | reserved schema for TOAST tables
pg_toast_temp_1 | postgres | |
public | postgres | postgres=UC/postgres +| standard public schema
| | =UC/postgres +|
| | powerbi=U/postgres +|
| | readonly=U/postgres +|
| | user=U/postgres |
N
IP
\c db;
create schema olap;
CREATE USER olap WITH password 'pass';
GRANT CONNECT ON DATABASE db TO olap;
GRANT USAGE ON SCHEMA olap TO olap;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA olap TO olap;
GRANT SELECT ON ALL TABLES IN SCHEMA olap TO olap;
ALTER DEFAULT PRIVILEGES IN SCHEMA olap GRANT SELECT ON SEQUENCES TO olap;
ALTER DEFAULT PRIVILEGES IN SCHEMA olap GRANT SELECT ON TABLES TO olap;
SB
A
db=> SHOW search_path;
search_path
-----------------
"$user", public
(1 row)
db=> CREATE TABLE public.checktable (
id character varying
);
CREATE TABLE
db=> drop table checktable
;
DROP TABLE
db=> SELECT SESSION_USER, CURRENT_USER;
session_user | current_user
----------------+----------------
olap | olap
(1 row)
N
N
SB
N
SB