lens_mobapp_trace=# create role lens with login;
NOTICE: resource queue required -- using default resource queue "pg_default"
CREATE ROLE
lens_mobapp_trace=# alter role lens with password 'nbs2010';
ALTER ROLE
lens_mobapp_trace=# grant all on database lens_mobapp_trace to lens;
GRANT
lens_mobapp_trace=# \h create schema
Command: CREATE SCHEMA
Description: define a new schema
Syntax:
CREATE SCHEMA schemaname [ AUTHORIZATION username ] [ schema_element [ ... ] ]
CREATE SCHEMA AUTHORIZATION username [ schema_element [ ... ] ]
lens_mobapp_trace=# create schema tingyun_trace AUTHORIZATION lens;
CREATE SCHEMA
lens_mobapp_trace=# alter role lens set search_path=tingyun_trace;
ALTER ROLE
转载于:https://blog.51cto.com/quenlang/1844798