Wednesday, April 27, 2016

postgresql: Owner to access schema. set public.

Unable to access schema that vc do not owned but have to specify the schema every time. This can be set.



postgres=# \c vcdb
psql (9.3.5, server 9.2.9)
You are now connected to database "vcdb" as user "postgres".
vcdb=# \dt
No relations found.
vcdb=# \dt vpx.vpx_version
          List of relations
 Schema |    Name     | Type  | Owner
--------+-------------+-------+-------
 vpx    | vpx_version | table | vc
(1 row)

vcdb=# SET search_path TO vpx,public;
SET
vcdb=# \dt vpx_version;
          List of relations
 Schema |    Name     | Type  | Owner
--------+-------------+-------+-------
 vpx    | vpx_version | table | vc
(1 row)

vcdb=# \dt
                    List of relations
 Schema |              Name              | Type  | Owner
--------+--------------------------------+-------+-------
 vpx    | vpx_access                     | table | vc
 vpx    | vpx_alarm                      | table | vc
 vpx    | vpx_alarm_action               | table | vc
 vpx    | vpx_alarm_disabled_actions     | table | vc
 vpx    | vpx_alarm_expr_comp            | table | vc
 vpx    | vpx_alarm_expression           | table | vc

 vpx    | vpx_alarm_repeat_action        | table | vc

No comments:

Post a Comment