1. Schema pgsql_tweaks
    1. Change the Schema

Schema pgsql_tweaks

Since pgsql_tweaks version 1.0.0 the extension is installed in a schema on its own, pgsql_tweaks. This is done to avoid conflicts with other extensions.
In the past functions in this extension clashed with functions named like the ones used in pgsql_tweaks, but had a different implementation returning different results.

The installation also creates a role pgsql_tweaks and all objects in the schema pgsql_tweaks are owned by this role.

To access the functions and/or views a connected role needs to be either, a superuser, a member of the role pgsql_tweaks, or to have rights granted.

-- Grant schema usage
GRANT USAGE USAGE ON SCHEMA pgsql_tweaks TO {rolename};

-- Grant all views
GRANT SELECT ON ALL TABLES IN SCHEMA pgsql_tweaks TO {rolename};

-- Grant function execution
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA pgsql_tweaks TO {rolename};

To use the functions and views without the schema name as prefix you can extend the search path for the current connection, or change the role search path.

See the PostgreSQL documentation about search_path for details.

Change the Schema

There is a PostgreSQL command to change the schema of an extension.

Example

-- Changes the schema localtion of the extension to the public schema
ALTER EXTENSION pgsql_tweaks SET SCHEMA public;