15 lines
582 B
SQL

-- Grant read-only access to the external contract schema.
--
-- Usage:
-- 1. Create the database role/user outside this script through the approved admin channel.
-- 2. Replace external_reader with the actual read-only role name if needed.
-- 3. Run this as a database administrator.
--
-- This script intentionally does not create users or include connection details.
GRANT USAGE ON SCHEMA external TO external_reader;
GRANT SELECT ON ALL TABLES IN SCHEMA external TO external_reader;
ALTER DEFAULT PRIVILEGES IN SCHEMA external
GRANT SELECT ON TABLES TO external_reader;