we test database migration to new db servers from version 12 to 15 and a problem with logical replication stopped us.
In the current code (PGSQL ver 12), we use a function with SECURITY DEFINER for refreshing subscriptions: --- DECLARE BEGIN execute 'alter subscription ' || sSubName || 'REFRESH PUBLICATION'; raise notice 'Subscription % refreshed', sSubName; END ---
The function is called during a deployment of a new version of our application when a deploy service account (NON-SUPERUSER) ENABLE and REFRESH subscriptions at the end of the deploy.
In version 15, unfortunately, we get the following error: ERROR: ALTER SUBSCRIPTION ... REFRESH cannot be executed from a function