PostgreSQL Permissions¶
Permissions in your PostgreSQL
The permissions on this page are granted in your own PostgreSQL, to the account Qualytics connects with, by whoever administers PostgreSQL at your company. They let Qualytics connect the datastore and read your data, and write to it when it is an enrichment datastore. They are not Qualytics roles or team permissions. To know which Qualytics user role (Admin, Manager, or Member) and team permission you need to connect the datastore in Qualytics, see Source Datastore Permissions.
Qualytics connects to PostgreSQL through the PostgreSQL JDBC driver. It reads the standard information schema to list the schemas the role can see, and uses standard JDBC metadata APIs for tables, columns, primary keys, and incremental fields.
Minimum PostgreSQL Permissions (Source Datastore)¶
| Permission | Purpose |
|---|---|
CONNECT ON DATABASE |
Allow the role to connect to the target database |
USAGE ON SCHEMA |
Access objects within the schema |
SELECT ON ALL TABLES IN SCHEMA |
Read data from all existing tables for profiling and scanning |
SELECT ON ALL SEQUENCES IN SCHEMA |
Read sequence metadata for incremental field detection |
Additional Permissions for an Enrichment Datastore¶
When PostgreSQL is used as an enrichment datastore, the following additional permissions are required so Qualytics can write its outputs, which are named from the linked source's prefix (for example _tpch_failed_checks):
| Permission | Purpose |
|---|---|
CREATE ON SCHEMA |
Create enrichment outputs |
INSERT ON ALL TABLES IN SCHEMA |
Write anomaly records, scan results, and check metrics |
UPDATE ON ALL TABLES IN SCHEMA |
Update enrichment records during rescans |
DELETE ON ALL TABLES IN SCHEMA |
Replace records when a run overwrites an output |
The database user that creates the enrichment tables owns them, so no additional grant is needed to change their structure during version migrations or to remove them during cleanup. PostgreSQL derives both from table ownership.
Example: Source Datastore Role (Read-Only)¶
Replace <database_name>, <schema_name>, and <password> with your actual values.
-- Create a dedicated read-only role
CREATE ROLE qualytics_read_role LOGIN PASSWORD '<password>';
-- Grant connection and schema access
GRANT CONNECT ON DATABASE <database_name> TO qualytics_read_role;
GRANT USAGE ON SCHEMA <schema_name> TO qualytics_read_role;
-- Grant read access to all existing and future tables
GRANT SELECT ON ALL TABLES IN SCHEMA <schema_name> TO qualytics_read_role;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA <schema_name> TO qualytics_read_role;
ALTER DEFAULT PRIVILEGES IN SCHEMA <schema_name> GRANT SELECT ON TABLES TO qualytics_read_role;
Example: Enrichment Database User (Read-Write)¶
-- Create a dedicated read-write role
CREATE ROLE qualytics_readwrite_role LOGIN PASSWORD '<password>';
-- Grant connection, schema access, and table creation
GRANT CONNECT ON DATABASE <database_name> TO qualytics_readwrite_role;
GRANT USAGE, CREATE ON SCHEMA <schema_name> TO qualytics_readwrite_role;
-- Grant full data manipulation on all existing and future tables
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA <schema_name> TO qualytics_readwrite_role;
ALTER DEFAULT PRIVILEGES IN SCHEMA <schema_name> GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO qualytics_readwrite_role;
Note
The information_schema, pg_catalog, pg_toast, and pg_internal schemas are left out of discovery, along with the temporary and statistics schemas PostgreSQL creates with a pg_ prefix. You do not need to restrict access to them manually.