MayaBack to Maya

Connector guide

Connect PostgreSQL safely

1. Create the read-only identity

Run the SQL below as the database owner after replacing the database, schema, and secret placeholders. Use an existing business schema when direct read access is appropriate, or create curated reporting views when sensitive columns or row-level boundaries require a narrower surface.

create role maya_reader login password '<generate-a-long-random-secret>'
  nosuperuser nocreatedb nocreaterole noreplication nobypassrls;
alter role maya_reader set default_transaction_read_only = on;
alter role maya_reader set statement_timeout = '15s';
alter role maya_reader set lock_timeout = '3s';
alter role maya_reader set idle_in_transaction_session_timeout = '15s';

grant connect on database your_database to maya_reader;
grant usage on schema your_approved_schema to maya_reader;
grant select on all tables in schema your_approved_schema to maya_reader;

-- Existing row-level security policies still apply.
-- Review future-table privileges separately.

The example grants current tables only. It deliberately does not alter default privileges for future tables. Existing PostgreSQL row-level security policies continue to apply and may legitimately hide rows from this service identity.

2. Gather your PostgreSQL connection details

Get these values from your database provider or administrator. Maya does not require Supabase; it connects through the standard PostgreSQL protocol.

3. Restrict network access

4. Enter the connection in Maya

Open Connections → PostgreSQL, then enter the connection name, host, port, database, dedicated reader, secret, optional CA certificate, approved schemas, and optional redacted columns. Secrets belong only in these protected fields—never in chat or a setup question.

5. Verify the boundary

6. Rotate or revoke

Rotate the reader secret regularly and immediately after suspected exposure. To revoke access, disconnect PostgreSQL in Maya and then disable or drop the database role.

Return to Maya →