'In using TAGs, are they universal to the database

I'm new to tagging. What is not clear to me is:

I want to use them for PII, when I create a tag, is that Tag specific to the Schema I'm in or can I use that tag across all the schemas for that database?



Solution 1:[1]

You can use your tags in all schemas/databases as long as you use the (database_name).schema.tag_name format.

If the tag is defined in another database (or in another schema):

create table test tag (gokhan_db.public.my_tag = 'Y')
(id number );

If it's defined in another schema but in the same database:

create table test tag (public.my_tag = 'Y')
(id number );

Solution 2:[2]

Yes, the tag you created under the schema is specific to the schema only, but as Gokhan mentioned, you can reference it from any database and schema, as long as you have the full path attached to the tag.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gokhan Atil
Solution 2 Eric Lin