An Azure managed PostgreSQL database service for app development and deployment.
HI @Tom Albrecht
Thank you for the detailed information.
What you're seeing is expected behavior on Azure Database for PostgreSQL Flexible Server. Extensions such as unaccent are managed by the service and owned by the internal Azure account (azuresu). Since Flexible Server does not provide superuser access, customers cannot modify extension-owned objects, including changing the volatility of the unaccent(text) function to IMMUTABLE.
As a result, the following command is not supported on Flexible Server:
ALTER FUNCTION unaccent(text) IMMUTABLE;
The challenge here is that Odoo's initialization logic assumes it can alter the built-in unaccent() function, which works on self-managed PostgreSQL deployments but not on managed PostgreSQL services where extension ownership is restricted.
For this scenario, the recommended approach would be to review whether your Odoo version supports using a custom wrapper function or an alternative configuration that avoids modifying the extension-owned function. If the application strictly requires altering the built-in unaccent() function, a PostgreSQL deployment with full superuser control (for example, PostgreSQL on an Azure VM) may be required.
At this time, Azure Database for PostgreSQL Flexible Server does not provide a supported mechanism to modify extension objects in template1 or change ownership of Azure-managed extension functions across future server deployments.
For more information, please refer to the following documentation:
- Azure Database for PostgreSQL Flexible Server – Extensions: https://learn.microsoft.com/azure/postgresql/flexible-server/concepts-extensions
- Azure Database for PostgreSQL Flexible Server – Security and roles: https://learn.microsoft.com/azure/postgresql/flexible-server/security-access-control