IBM Support

Prevent synonyms from appearing in public group

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.

[{"Product":{"code":"SSULQD","label":"IBM PureData System"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":null,"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

NZ387939

Document Information

Modified date:
17 October 2019

UID

swg21567961