pg_role_meta
is a PostgreSQL extension that introduces a key-value store mechanism for PostgreSQL roles. This feature allows for the association of custom metadata with database roles, facilitating enhanced role management and customization.
- Custom Metadata Association: Attach key-value pairs to PostgreSQL roles for storing additional information.
- Enhanced Role Management: Utilize metadata to manage roles more effectively within the database.
- Seamless Integration: Operate entirely within PostgreSQL, eliminating the need for external tools.
Before installing pg_role_meta
, ensure you have the following:
- PostgreSQL 9.6 or higher
-
Clone the Repository:
git clone https://github.com/brunoenten/pg_role_meta.git
-
Navigate to the Directory:
cd pg_role_meta
-
Build and Install the Extension:
make sudo make install
-
Load the Extension in PostgreSQL:
CREATE EXTENSION role_meta;
After installation, you can begin associating metadata with roles. For example, to add metadata to a role:
-- Add metadata to a role
SELECT role_meta.set_to_role('role_name', 'key', 'value');
-- Retrieve metadata for a role
SELECT role_meta.get_from_role('role_name', 'key');
-- Add metadata to current user
SELECT role_meta.set_to_current_user('key', 'value');
-- Retrieve metadata for current user
SELECT role_meta.get_from_current_user('key');
Replace 'role_name'
, 'key'
, and 'value'
with your specific role name and metadata details.
Contributions are welcome! Please fork the repository and submit a pull request with your enhancements or bug fixes.
This project is licensed under the GPL-3.0 License. See the LICENSE.txt file for details.
Special thanks to the PostgreSQL community for their continuous support and development of the database system.
Note: This extension is a community-driven project and is not officially supported by the PostgreSQL Global Development Group.