How to delete global variables set in PostgreSQL
This is not really a variable, but a &ldquo;placeholder parameter&rdquo;, and once you have set it, there is no way to &ldquo;undefine&rdquo; it for the lifetime of the database session.

Using it as a variable is actually abusing the concept, which is to allow specifying extension parameters in postgresql.conf even before the extension is loaded.

You could set the parameter to an empty value (or some other special value) to indicate that you want to unset it.

Alternatively, consider storing such variables in a temporary table, which will automatically be deleted as soon as the database session is done.