An Azure managed PostgreSQL database service for app development and deployment.
Hi Harry Georgilas,
1.Restrictions on anon.transparent_dynamic_masking and Other anon.* Parameters:
Intentional restriction by design on Azure Database for PostgreSQL Flexible Server to block GUC change from porta, but regarding to session/ database level the should be able to. That has been removed in late versions (2.4+), they can set it at database level too, let the customer aware that PG 13 has reached the community retirement date, and the extended support will end by April 1_st_ 2026, so we recommend the customer to move to higher versions like PG16 to have a complete support and also to protect from any unexpected behaviour or bugs.
postgres=> alter database postgres set anon.transparent_dynamic_masking = on;
ALTER DATABASE
postgres=>
2.What could be causing our custom schema to be dropped? Are there Azure maintenance processes that affect user-created schemas?
This does not sound like expected behaviour and could represent a misconfiguration or some process interference that dropped the schema, to be sure and understand more, we can suggest the customer to:
- Enable detailed logging in Azure (set log_min_duration_statement to 0 and enable pgaudit and repro the issue.
- monitor via Azure Log Analytics) to capture the drop events and see from where it is coming from.
- Turn off the auditing if not needed.
3.Is placing custom masking functions in the public schema supported for use with anon security labels?
The inability to create functions in the anon schema is by design and expected—extension schemas are protected to prevent modifications that could break the extension or introduce security risks. This is consistent across all of our versions
Public Schema Support: Yes, placing custom masking functions in the public schema is officially supported for use with anon's security labels (e.g., SECURITY LABEL FOR anon ON FUNCTION public.my_custom_function IS 'MASKED'. It's not ideal from a best-practice standpoint (as public can become cluttered), but it's should work without issues.
Recommended Alternative Schema Pattern for Azure: Instead of public, create a dedicated schema like masking_utils. Tag it as 'TRUSTED' per anon's docs. If drops persist (hopefully it is not), consider check the log analytics to see who did that, and use the below alternatives:
- Storing functions in a schema owned by a role with limited privileges.
- Using PostgreSQL's search_path to isolate them without relying on custom schemas.
4.What is the roadmap for anon extension updates on Flexible Server?
The latest version 2.4.0 will be available in the next Dataplane deployment (M54) part of our servers have it, the rest will be early in Jan 26, for newly created servers, they should be able to see that extension with latest version.
Please let us know if you have any questions and concerns.