Question & Answer
Question
How do I restrict synonyms from being listed in the 'public' group?
Answer
By default, synonyms created by the 'admin' user are visible to the 'public' group. This is shown in the following example:
TEST(USER)=> \d
List of relations
Name | Type | Owner
--------+---------+-------
TESTER | SYNONYM | ADMIN
(1 row)
If you want to prevent synonyms from appearing in the description of the 'public' group, run the following statements within nzsql logged in as the 'admin' user in the 'system' database:
SYSTEM(ADMIN)=> revoke list on synonym from public ;
REVOKE
SYSTEM(ADMIN)=> revoke select on synonym from public ;
REVOKE
The following output shows that synonyms are now hidden.
TEST(USER)=> \d
No relations found.
Historical Number
NZ387939
Was this topic helpful?
Document Information
Modified date:
17 October 2019
UID
swg21567961